ctucx.git: nixfiles

ctucx' nixfiles

commit 06bdbea511af76a08a90290ce1f2fd6edd49518b
parent 283a1152b584cb4041fee6890e5da65fc3c33da0
Author: Leah (ctucx) <git@ctu.cx>
Date: Mon, 22 Jan 2024 13:42:20 +0100

machines/briefkasten/websites: add `audiobooks.home.ctu.cx`
2 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/machines/briefkasten/websites/audiobooks.home.ctu.cx.nix b/machines/briefkasten/websites/audiobooks.home.ctu.cx.nix
@@ -0,0 +1,31 @@
+{ config, pkgs, lib, ... }:
+
+{
+
+  dns.zones."ctu.cx".subdomains."audiobooks.home".CNAME = lib.mkIf config.networking.usePBBUplink [  "${config.networking.fqdn}." ];
+
+  fileSystems."/mnt/audiobooks" = {
+    device = "/nix/persist/home/leah/syncthing/Audiobooks";
+    options = [ "bind" "ro" ];
+  };
+
+  services.nginx = {
+    enable = true;
+    virtualHosts."audiobooks.home.ctu.cx" = {
+      enableACME = lib.mkIf config.networking.usePBBUplink true;
+      forceSSL   = lib.mkIf config.networking.usePBBUplink true;
+      kTLS       = lib.mkIf config.networking.usePBBUplink true;
+
+      locations = {
+        "/jdfoniobhfijnfoilp[dfponbiuyfbu/".alias = "/mnt/audiobooks/";
+      };
+
+      extraConfig = ''
+#       auth_basic 'Auth required';
+#       auth_basic_user_file ${pkgs.writeText "auth-file" "giveme:$apr1$Em5EfPWk$kYnKJF1mIsd2h4heYNfEB."};
+      '';
+    };
+  };
+
+}
+
diff --git a/machines/briefkasten/websites/default.nix b/machines/briefkasten/websites/default.nix
@@ -5,6 +5,7 @@
   imports = [
     ./wiki.home.ctu.cx.nix
     ./music.home.ctu.cx.nix
+    ./audiobooks.home.ctu.cx.nix
 #    ./storage.home.ctu.cx
 
     ./photos.ctu.cx.nix