diff options
| author | Caroline Larimore <caroline@larimo.re> | 2025-04-14 14:54:40 -0700 |
|---|---|---|
| committer | Caroline Larimore <caroline@larimo.re> | 2025-04-14 18:58:53 -0700 |
| commit | 5ee9dd8cf0bbf837f967f6c902b8fd3c427ff495 (patch) | |
| tree | d5949ceb2fbade754e2083f7b84ac9edf36f867e /snowfall | |
| parent | 5a8d24052232b776858aae9d63da58169db62465 (diff) | |
migration: image webserver
Diffstat (limited to 'snowfall')
| -rw-r--r-- | snowfall/modules/nixos/services/web/images/default.nix | 34 | ||||
| -rw-r--r-- | snowfall/systems/x86_64-linux/copenhagen/default.nix | 1 |
2 files changed, 35 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"; + }; + }; + }; + }; +} diff --git a/snowfall/systems/x86_64-linux/copenhagen/default.nix b/snowfall/systems/x86_64-linux/copenhagen/default.nix index ff0c0ed..20bfabb 100644 --- a/snowfall/systems/x86_64-linux/copenhagen/default.nix +++ b/snowfall/systems/x86_64-linux/copenhagen/default.nix @@ -18,6 +18,7 @@ with lib; with lib.${namespace}; { services = { web = { enable = true; + images.enable = true; } } }; |