diff options
Diffstat (limited to 'modules/nixos/services/web/landing')
| -rw-r--r-- | modules/nixos/services/web/landing/default.nix | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/modules/nixos/services/web/landing/default.nix b/modules/nixos/services/web/landing/default.nix new file mode 100644 index 0000000..fe9e92b --- /dev/null +++ b/modules/nixos/services/web/landing/default.nix @@ -0,0 +1,34 @@ +{ options, config, lib, namespace, ... }: + +with lib; with lib.${namespace}; let + cfg = config.${namespace}.services.web.landing; + impermanence = config.${namespace}.system.impermanence; +in { + options.${namespace}.services.web.landing = with types; { + enable = mkEnableOption "cxl.sh landing page webserver"; + }; + + config = mkIf cfg.enable { + cxl.services.web.enable = true; + + environment.persistence.${impermanence.location} = { + directories = [ + "/srv/web/landing" + ]; + }; + + networking.firewall.allowedTCPPorts = [ 80 443 ]; + + services.nginx = { + enable = true; + virtualHosts = { + "cxl.sh" = { + addSSL = true; + enableACME = true; + + root = "/srv/web/landing"; + }; + }; + }; + }; +} |