diff options
| -rw-r--r-- | hosts/copenhagen/configuration.nix | 2 | ||||
| -rw-r--r-- | roles/web/default.nix | 5 | ||||
| -rw-r--r-- | snowfall/modules/nixos/services/web/default.nix | 23 | ||||
| -rw-r--r-- | snowfall/systems/x86_64-linux/copenhagen/default.nix | 6 |
4 files changed, 29 insertions, 7 deletions
diff --git a/hosts/copenhagen/configuration.nix b/hosts/copenhagen/configuration.nix index 73cacac..99fd89f 100644 --- a/hosts/copenhagen/configuration.nix +++ b/hosts/copenhagen/configuration.nix @@ -3,8 +3,6 @@ { environment.persistence."/persist/system" = { directories = [ - "/var/lib/acme" - "/srv/web" "/srv/minecraft" ]; diff --git a/roles/web/default.nix b/roles/web/default.nix index 5606240..d15d682 100644 --- a/roles/web/default.nix +++ b/roles/web/default.nix @@ -6,9 +6,4 @@ ./personal ./stargazers ]; - - security.acme = { - acceptTerms = true; - defaults.email = "caroline@larimo.re"; - }; } diff --git a/snowfall/modules/nixos/services/web/default.nix b/snowfall/modules/nixos/services/web/default.nix new file mode 100644 index 0000000..1e1e854 --- /dev/null +++ b/snowfall/modules/nixos/services/web/default.nix @@ -0,0 +1,23 @@ +{ options, config, lib, namespace, ... }: + +with lib; with lib.${namespace}; let + cfg = config.${namespace}.services.web; + impermanence = config.${namespace}.system.impermanence; +in { + options.${namespace}.services.web = with types; { + enable = mkEnableOption "web"; + }; + + config = mkIf cfg.enable { + environment.persistence.${impermanence.location} = { + directories = [ + "/var/lib/acme" + ]; + }; + + security.acme = { + acceptTerms = true; + defaults.email = "caroline@larimo.re"; + }; + }; +} diff --git a/snowfall/systems/x86_64-linux/copenhagen/default.nix b/snowfall/systems/x86_64-linux/copenhagen/default.nix index 38705a8..ff0c0ed 100644 --- a/snowfall/systems/x86_64-linux/copenhagen/default.nix +++ b/snowfall/systems/x86_64-linux/copenhagen/default.nix @@ -14,6 +14,12 @@ with lib; with lib.${namespace}; { impermanence.enable = true; impermanence.home.enable = true; }; + + services = { + web = { + enable = true; + } + } }; system.stateVersion = "23.11"; |