diff --git a/configuration.nix b/configuration.nix index df27387..9378fac 100644 --- a/configuration.nix +++ b/configuration.nix @@ -34,6 +34,9 @@ ./services/ups.nix ./services/bitwarden.nix + + # KEEP UNTIL 2028 + ./services/caddy_senior_project.nix ]; systemd.targets = { diff --git a/flake.nix b/flake.nix index 7f7f884..cac6f54 100644 --- a/flake.nix +++ b/flake.nix @@ -90,6 +90,10 @@ certs = services_dir + "/http_certs"; # TODO! generate website from repo directly using hugo data_dir = services_dir + "/http/www"; + + # KEEP UNTIL 2028 + senior_project_dir = services_dir + "/http/senior_project"; + domain = "gardling.com"; wg_ip = "192.168.15.1"; matrix_hostname = "matrix.${service_configs.https.domain}"; diff --git a/services/caddy_senior_project.nix b/services/caddy_senior_project.nix new file mode 100644 index 0000000..9fc941e --- /dev/null +++ b/services/caddy_senior_project.nix @@ -0,0 +1,23 @@ +{ + config, + lib, + pkgs, + service_configs, + ... +}: +{ + imports = [ + (lib.serviceMountDeps "caddy" [ + service_configs.https.senior_project_dir + ]) + ]; + + services.caddy.virtualHosts."senior-project".extraConfig = '' + root * ${service_configs.https.senior_project_dir} + file_server browse + ''; + + systemd.tmpfiles.rules = [ + "d ${service_configs.https.senior_project_dir} 770 ${config.services.caddy.user} ${config.services.caddy.group}" + ]; +}