Commit f4cca83c3955

Vincent Demeester <vincent@sbr.pm>
2026-04-01 10:33:21
feat(rhea): migrate audiobooks, music, ebooks, documents to /zion
Moved four directories from /neo to /zion (separate 3.6T disk) for replicated media. Updated NFS exports, Samba shares, calibre, webdav, beets, and rsync-replica paths. Added rootPath option to nfs-mounts module for multi-root NFS servers. NFS clients now mount these at /net/zion/ instead of /net/rhea/.
1 parent 016e83b
Changed files (5)
systems/aion/extra.nix
@@ -202,8 +202,8 @@ in
         rhea-daily = rheaBackupDefaults // {
           source = rheaBackupDefaults.source // {
             paths = [
-              "/neo/documents"
-              "/neo/ebooks"
+              "/zion/documents"
+              "/zion/ebooks"
             ];
           };
           schedule = "daily";
systems/common/services/nfs-mounts.nix
@@ -15,7 +15,7 @@ let
       map (folder: {
         name = "/net/${hostName}/${folder}";
         value = {
-          device = "${hostCfg.server}:/${folder}"; # NFSv4: path relative to fsid=0
+          device = "${hostCfg.server}:${hostCfg.rootPath}/${folder}"; # NFSv4: path relative to export root
           fsType = "nfs";
           options = [
             "nfsvers=4.2" # Use NFSv4.2 for best performance
@@ -42,6 +42,12 @@ in
               example = "rhea.sbr.pm";
               description = "NFS server hostname or IP";
             };
+            rootPath = lib.mkOption {
+              type = lib.types.str;
+              default = "";
+              example = "/zion";
+              description = "Root path prefix on the NFS server (for servers with multiple export roots)";
+            };
             folders = lib.mkOption {
               type = lib.types.listOf lib.types.str;
               default = [ ];
systems/rhea/extra.nix
@@ -12,19 +12,23 @@ let
   serviceDefaults = libx.mkServiceDefaults { };
 
   # Samba shares configuration (data-driven approach)
-  sambaShares = {
+  # Samba shares on /neo
+  neoSambaShares = {
+    backup = { };
+    downloads = { };
+    pictures = { };
+    videos = { };
+  };
+  # Samba shares on /zion
+  zionSambaShares = {
     audiobooks = {
       readOnly = true;
     };
     ebooks = { };
-    backup = { };
     documents = { };
-    downloads = { };
     music = {
       readOnly = true;
     };
-    pictures = { };
-    videos = { };
   };
 
   # Exportarr services configuration (data-driven approach)
@@ -57,7 +61,7 @@ let
       host = "aion.sbr.pm";
       user = "vincent";
     };
-    destination = "/neo";
+    destination = "/zion";
     delete = true; # Mirror mode: delete files in destination that don't exist in source
     user = "vincent";
     group = "users";
@@ -445,7 +449,17 @@ in
         }
         // cfg
       )
-    ) sambaShares;
+    ) neoSambaShares
+    // builtins.mapAttrs (
+      name: cfg:
+      libx.mkSambaShare (
+        {
+          inherit name;
+          path = "/zion/${name}";
+        }
+        // cfg
+      )
+    ) zionSambaShares;
     nfs.server = {
       enable = true;
       # Fixed ports for firewall configuration
@@ -454,14 +468,15 @@ in
       statdPort = 4000;
       exports = ''
                 /neo                      192.168.1.0/24(rw,fsid=0,no_subtree_check) 10.100.0.0/24(rw,fsid=0,no_subtree_check)
-                /neo/audiobooks           192.168.1.0/24(ro,fsid=1,no_subtree_check) 10.100.0.0/24(ro,fsid=1,no_subtree_check)
                 /neo/backup               192.168.1.0/24(rw,fsid=2,no_subtree_check) 10.100.0.0/24(rw,fsid=2,no_subtree_check)
-                /neo/documents            192.168.1.0/24(rw,fsid=3,no_subtree_check) 10.100.0.0/24(rw,fsid=3,no_subtree_check)
                 /neo/downloads            192.168.1.0/24(rw,fsid=4,no_subtree_check) 10.100.0.0/24(rw,fsid=4,no_subtree_check)
-                /neo/ebooks               192.168.1.0/24(rw,fsid=5,no_subtree_check) 10.100.0.0/24(rw,fsid=5,no_subtree_check)
-                /neo/music                192.168.1.0/24(ro,fsid=6,no_subtree_check) 10.100.0.0/24(ro,fsid=6,no_subtree_check)
                 /neo/pictures             192.168.1.0/24(rw,fsid=7,no_subtree_check) 10.100.0.0/24(rw,fsid=7,no_subtree_check)
                 /neo/videos               192.168.1.0/24(rw,fsid=8,no_subtree_check) 10.100.0.0/24(rw,fsid=8,no_subtree_check)
+                /zion                     192.168.1.0/24(rw,fsid=10,no_subtree_check) 10.100.0.0/24(rw,fsid=10,no_subtree_check)
+                /zion/audiobooks          192.168.1.0/24(ro,fsid=11,no_subtree_check) 10.100.0.0/24(ro,fsid=11,no_subtree_check)
+                /zion/documents           192.168.1.0/24(rw,fsid=12,no_subtree_check) 10.100.0.0/24(rw,fsid=12,no_subtree_check)
+                /zion/ebooks              192.168.1.0/24(rw,fsid=13,no_subtree_check) 10.100.0.0/24(rw,fsid=13,no_subtree_check)
+                /zion/music               192.168.1.0/24(ro,fsid=14,no_subtree_check) 10.100.0.0/24(ro,fsid=14,no_subtree_check)
         			'';
     };
     immich = serviceDefaults // {
@@ -494,7 +509,7 @@ in
       settings = {
         address = "127.0.0.1";
         port = 6065;
-        scope = "/neo/documents/boox";
+        scope = "/zion/documents/boox";
         modify = true;
         users = [
           {
@@ -684,13 +699,13 @@ in
       jobs = {
         aion-music-hourly = aionBackupDefaults // {
           source = aionBackupDefaults.source // {
-            paths = [ "/neo/music" ];
+            paths = [ "/zion/music" ];
           };
           schedule = "hourly";
         };
         aion-audiobooks-daily = aionBackupDefaults // {
           source = aionBackupDefaults.source // {
-            paths = [ "/neo/audiobooks" ];
+            paths = [ "/zion/audiobooks" ];
           };
           schedule = "daily";
         };
@@ -818,7 +833,7 @@ in
 
     serviceConfig = {
       Type = "simple";
-      ExecStart = "${pkgs.calibre}/bin/calibre-server --port=8083 /neo/ebooks";
+      ExecStart = "${pkgs.calibre}/bin/calibre-server --port=8083 /zion/ebooks";
       Restart = "on-failure";
       User = "vincent";
       Group = "users";
systems/rhea/home.nix
@@ -1,6 +1,6 @@
 { ... }:
 {
   imports = [
-    (import ../../home/common/services/beets.nix { baseDir = "/neo/music"; })
+    (import ../../home/common/services/beets.nix { baseDir = "/zion/music"; })
   ];
 }
globals.nix
@@ -87,11 +87,20 @@ _: {
           server = "rhea.sbr.pm";
           folders = [
             "downloads"
-            "ebooks"
             "pictures"
             "videos"
           ];
         };
+        zion = {
+          server = "rhea.sbr.pm";
+          rootPath = "/zion";
+          folders = [
+            "audiobooks"
+            "documents"
+            "ebooks"
+            "music"
+          ];
+        };
         aion = {
           server = "aion.sbr.pm";
           folders = [