53 lines
1.1 KiB
Nix
53 lines
1.1 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
service_configs,
|
|
inputs,
|
|
...
|
|
}:
|
|
let
|
|
theme = pkgs.fetchFromGitHub {
|
|
owner = "kaiiiz";
|
|
repo = "hugo-theme-monochrome";
|
|
rev = "d17e05715e91f41a842f2656e6bdd70cba73de91";
|
|
sha256 = "h9I2ukugVrldIC3SXefS0L3R245oa+TuRChOCJJgF24=";
|
|
};
|
|
|
|
hugoWebsite = pkgs.stdenv.mkDerivation {
|
|
pname = "hugo-site";
|
|
version = "0.1";
|
|
|
|
src = inputs.senior_project-website;
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
hugo
|
|
];
|
|
|
|
installPhase = ''
|
|
rm -fr themes/theme
|
|
cp -rv ${theme} themes/theme
|
|
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}"
|
|
];
|
|
}
|