move sites to their own modules

This commit is contained in:
zackartz 2024-05-24 11:42:49 -04:00
parent e83f4ded85
commit 5be0c2ab5b
No known key found for this signature in database
GPG key ID: 5B53E53A9A514DBA
18 changed files with 707 additions and 654 deletions

View file

@ -0,0 +1,34 @@
{
lib,
config,
pkgs,
inputs,
...
}:
with lib;
with lib.custom; let
cfg = config.sites.cv;
in {
options.sites.cv = with types; {
enable = mkBoolOpt false "Enable CV site";
domain = mkStringOpt "cv.zackster.zip" "The domain for the site";
};
config = mkIf cfg.enable {
warnings =
lib.optional (!config.services.nginx.enable)
"CV site is enabled, but it depends on Nginx which is not enabled.";
services.nginx.virtualHosts.${cfg.domain} = {
forceSSL = true;
enableACME = true;
locations."/" = {
root = "${inputs.resume.packages.${pkgs.system}.default}";
};
extraConfig = ''
index resume.pdf;
'';
};
};
}