zaphyra's git: nixfiles

zaphyra and void's nixfiles

commit 641fa0d4eb9f3d5555cef6417a15cb236d82e14d
parent d3be598968ca0ccebaa86ecec74ffd8c8ea7ab61
Author: Katja (zaphyra) <git@ctu.cx>
Date: Tue, 27 May 2025 17:32:19 +0200

config/nixos/modules/websites: add `katja.wtf` (and enable on host `morio`)
2 files changed, 45 insertions(+), 0 deletions(-)
A
config/nixos/modules/websites/katja.wtf.nix
|
44
++++++++++++++++++++++++++++++++++++++++++++
M
hosts/morio/default.nix
|
1
+
diff --git a/config/nixos/modules/websites/katja.wtf.nix b/config/nixos/modules/websites/katja.wtf.nix
@@ -0,0 +1,44 @@
+{
+  povSelf,
+  hostConfig,
+  config,
+  pkgs,
+  lib,
+  dnsNix,
+  ...
+}:
+
+let
+  inherit (lib) types;
+  cfg = lib.getAttrFromPath povSelf config;
+
+in
+{
+
+  options = {
+    enable = {
+      type = types.bool;
+      default = false;
+    };
+    domain = {
+      type = types.str;
+      default = "katja.wtf";
+    };
+  };
+
+  config = lib.mkIf cfg.enable {
+    dns.zones."${cfg.domain}" =
+      dnsNix.combinators.host hostConfig.networking.ip4Address hostConfig.networking.ip6Address;
+
+    services.nginx = {
+      enable = true;
+      virtualHosts."${cfg.domain}" = {
+        useACMEHost = "${config.networking.fqdn}";
+        forceSSL = true;
+        kTLS = true;
+        root = pkgs.zaphyra-website;
+      };
+    };
+  };
+
+}
diff --git a/hosts/morio/default.nix b/hosts/morio/default.nix
@@ -82,6 +82,7 @@
           "grafana.infra.zaphyra.eu".enable = true;
 
           "zaphyra.eu".enable = true;
+          "katja.wtf".enable = true;
           "git.zaphyra.eu".enable = true;
           "bikemap.zaphyra.eu".enable = true;
           "dav.zaphyra.eu".enable = true;