diff --git a/modules/server/services/default.nix b/modules/server/services/default.nix index 366e4b57..4a85347e 100644 --- a/modules/server/services/default.nix +++ b/modules/server/services/default.nix @@ -1 +1 @@ -{ imports = [ ./forgejo ./headscale.nix ./local ]; } +{ imports = [ ./forgejo ./headscale.nix ./local ./sakosite.nix ]; } diff --git a/modules/server/services/sakosite.nix b/modules/server/services/sakosite.nix new file mode 100644 index 00000000..6f9cc290 --- /dev/null +++ b/modules/server/services/sakosite.nix @@ -0,0 +1,22 @@ +{ config, lib, ... }: +with lib; +let cfg = config.void.services.sakosite; +in { + options.void.server.services.sakosite = { enable = mkEnableOption false; }; + + config = mkIf cfg.enable { + security.acme.certs."sako.lol" = { + credentialsFile = "/srv/secrets/porkbun"; + dnsProvider = "porkbun"; + webroot = null; + }; + services = { + nginx.virtualHosts."sako.lol" = { + enableACME = true; + forceSSL = true; + root = "/srv/static/sakosite"; + }; + }; + + }; +}