zaphyra's git: nixfiles

zaphyra's nixfiles

commit cee1856c794b8814184204cd431293b4239596b5
parent 2452abccc4daee6d19b29c466bf0e603f03a96ee
Author: Katja Ramona Sophie Kwast (zaphyra) <git@zaphyra.eu>
Date: Wed, 15 Oct 2025 11:34:31 +0200

config/nixos/modules/websites/music.zaphyra.dn42: add clearnet url
1 file changed, 24 insertions(+), 8 deletions(-)
M
config/nixos/modules/websites/music.zaphyra.dn42.nix
|
32
++++++++++++++++++++++++--------
diff --git a/config/nixos/modules/websites/music.zaphyra.dn42.nix b/config/nixos/modules/websites/music.zaphyra.dn42.nix
@@ -30,9 +30,14 @@ in
   };
 
   config = lib.mkIf cfg.enable {
-    dns.zones."${cfg.domain}".subdomains."${cfg.subdomain}".AAAA = [
-      hostConfig.networking.dn42Address
-    ];
+    dns.zones = {
+      "${cfg.domain}".subdomains."${cfg.subdomain}".AAAA = [
+        hostConfig.networking.dn42Address
+      ];
+      "zaphyra.eu".subdomains."${cfg.subdomain}".AAAA = [
+        hostConfig.networking.ip6Address
+      ];
+    };
 
     fileSystems."/mnt/music" = {
       device = "/home/zaphyra/Music";

@@ -69,11 +74,22 @@ in
       dnsProvider = null;
     };
 
-    services.nginx.virtualHosts."${cfg.subdomain}.${cfg.domain}" = {
-      enableACME = true;
-      forceSSL = true;
-      kTLS = true;
-      locations."/".proxyPass = "http://[::1]:${toString config.services.navidrome.settings.Port}/";
+    services.nginx = {
+      enable = true;
+      virtualHosts = {
+        "${cfg.subdomain}.${cfg.domain}" = {
+          enableACME = true;
+          forceSSL = true;
+          kTLS = true;
+          locations."/".proxyPass = "http://[::1]:${toString config.services.navidrome.settings.Port}/";
+        };
+        "${cfg.subdomain}.zaphyra.eu" = {
+          useACMEHost = "${config.networking.fqdn}";
+          forceSSL = true;
+          kTLS = true;
+          locations."/".proxyPass = "http://[::1]:${toString config.services.navidrome.settings.Port}/";
+        };
+      };
     };
   };