From 215c06c75330e8042c5379078eccae7b19d83a8c Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 4 Jan 2025 21:02:06 +0400 Subject: [PATCH] add sakosite --- modules/server/services/default.nix | 2 +- modules/server/services/sakosite.nix | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 modules/server/services/sakosite.nix 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"; + }; + }; + + }; +}