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