44 lines
807 B
Nix
44 lines
807 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
service_configs,
|
|
inputs,
|
|
...
|
|
}:
|
|
let
|
|
hugoWebsite = pkgs.stdenv.mkDerivation {
|
|
pname = "hugo-site";
|
|
version = "0.1";
|
|
|
|
src = inputs.senior_project-website;
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
hugo
|
|
];
|
|
|
|
installPhase = ''
|
|
hugo --minify -d $out;
|
|
'';
|
|
};
|
|
in
|
|
{
|
|
imports = [
|
|
# TODO! fix conflicting definition values
|
|
/*
|
|
(lib.serviceMountDeps "caddy" [
|
|
service_configs.https.senior_project_dir
|
|
])
|
|
*/
|
|
];
|
|
|
|
services.caddy.virtualHosts."senior-project.${service_configs.https.domain}".extraConfig = ''
|
|
root * ${hugoWebsite}
|
|
file_server browse
|
|
'';
|
|
|
|
systemd.tmpfiles.rules = [
|
|
"d ${service_configs.https.senior_project_dir} 770 ${config.services.caddy.user} ${config.services.caddy.group}"
|
|
];
|
|
}
|