zaphyra's git: nixfiles

zaphyra and void's nixfiles

commit 461e8b1c1ba97a48a96592d89975867458031df5
parent 132c5f25ba280389d9eb86e8924e145ca0fdbd99
Author: Katja (zaphyra) <git@ctu.cx>
Date: Sat, 24 May 2025 18:00:04 +0200

config/nixos/websites: add `zaphyra.eu`
2 files changed, 43 insertions(+), 0 deletions(-)
A
config/nixos/modules/websites/zaphyra.eu.nix
|
42
++++++++++++++++++++++++++++++++++++++++++
M
hosts/morio/default.nix
|
1
+
diff --git a/config/nixos/modules/websites/zaphyra.eu.nix b/config/nixos/modules/websites/zaphyra.eu.nix
@@ -0,0 +1,42 @@
+{
+  povSelf,
+  hostConfig,
+  config,
+  lib,
+  dnsNix,
+  ...
+}:
+
+let
+  inherit (lib) types;
+  cfg = lib.getAttrFromPath povSelf config;
+
+in
+{
+
+  options = {
+    enable = {
+      type = types.bool;
+      default = false;
+    };
+    domain = {
+      type = types.str;
+      default = "zaphyra.eu";
+    };
+  };
+
+  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;
+      };
+    };
+  };
+
+}
diff --git a/hosts/morio/default.nix b/hosts/morio/default.nix
@@ -78,6 +78,7 @@
           "prometheus.infra.zaphyra.eu".enable = true;
           "grafana.infra.zaphyra.eu".enable = true;
 
+          "zaphyra.eu".enable = true;
           "git.zaphyra.eu".enable = true;
           "bikemap.zaphyra.eu".enable = true;
           "dav.zaphyra.eu".enable = true;