diff --git a/modules/hosts/14900k/_private/media-disk.nix b/modules/hosts/14900k/_private/media-disk.nix index 2c76932..cad79fe 100644 --- a/modules/hosts/14900k/_private/media-disk.nix +++ b/modules/hosts/14900k/_private/media-disk.nix @@ -1,9 +1,5 @@ # Extra local disks. Declared here, not in hardware.nix (hardware.nix is generated). { config, lib, ... }: -let - # Stable UID so NTFS `uid=` matches `users.users.olivier` (override if your account is not 1000). - olivierUid = config.users.users.olivier.uid or 1000; -in { users.users.olivier.uid = lib.mkDefault 1000; # LABEL="MediaLibrary" (btrfs on sda1 by UUID). No subvol=@ — this disk has no @ subvolume. @@ -33,15 +29,4 @@ in # LABEL="Deep Storage Unit". Owner olivier, group nfsmedia (990) so: # - local logins write as user 1000 (owner rwx); # - NFS (all_squash → uid/gid 990) matches group 990 → rwx (see jellyfin-nfs-export). - #fileSystems."/mnt/test" = { - # device = "/dev/disk/by-uuid/BC12E55E12E51DE0"; - # fsType = "ntfs-3g"; - # options = [ - # "rw" - # "force" - # "uid=${toString olivierUid}" - # "gid=990" - # "umask=0002" - # ]; - #}; } diff --git a/modules/hosts/nix-server/_services/nixdesk-nfs-client.nix b/modules/hosts/nix-server/_services/nixdesk-nfs-client.nix deleted file mode 100644 index 76422f3..0000000 --- a/modules/hosts/nix-server/_services/nixdesk-nfs-client.nix +++ /dev/null @@ -1,35 +0,0 @@ -# NFS mounts of nixdesk (14900k) bulk storage for nix-server. Exports live in -# modules/hosts/14900k/_private/jellyfin-nfs-export.nix -# -# Jellyfin library paths (see also services/jellyfin.nix): -# Movies → /mnt/nixdesk-jellyfin/movies -# Shows → /mnt/nixdesk-jellyfin/tv -# -# If you see "Stale file handle" under /mnt after changing exports or fsid on nixdesk, drop the -# old client mount and let automount reattach, e.g.: -# sudo umount -l /mnt/nixdesk-jellyfin -# ls /mnt/nixdesk-jellyfin -# (or reboot nix-server.) -{ ... }: -let - nfsExportHost = "192.168.2.25"; - # nfsvers+tcp: predictable Linux↔Linux; lookupcache=none: fewer stale dentries after export changes. - nfsClientOpts = [ - "rw" - "noatime" - "nofail" - "_netdev" - "nfsvers=3" - "tcp" - "lookupcache=none" - "x-systemd.automount" - "x-systemd.idle-timeout=3600" - ]; -in -{ - fileSystems."/mnt/nixdesk-jellyfin" = { - device = "${nfsExportHost}:/mnt/deep/jellyfin"; - fsType = "nfs"; - options = nfsClientOpts; - }; -} diff --git a/modules/hosts/r5500/_services/nixdesk-nfs-client.nix b/modules/hosts/r5500/_services/nixdesk-nfs-client.nix deleted file mode 100644 index 9b32db3..0000000 --- a/modules/hosts/r5500/_services/nixdesk-nfs-client.nix +++ /dev/null @@ -1,28 +0,0 @@ -# NFS mounts of nixdesk (14900k) bulk storage for r5500. Exports live in -# modules/hosts/14900k/_private/jellyfin-nfs-export.nix -# -# Jellyfin library paths: -# Movies → /mnt/nixdesk-jellyfin/movies -# Shows → /mnt/nixdesk-jellyfin/tv -{ ... }: -let - nfsExportHost = "192.168.2.25"; - nfsClientOpts = [ - "rw" - "noatime" - "nofail" - "_netdev" - "nfsvers=3" - "tcp" - "lookupcache=none" - "x-systemd.automount" - "x-systemd.idle-timeout=3600" - ]; -in -{ - fileSystems."/mnt/nixdesk-jellyfin" = { - device = "${nfsExportHost}:/mnt/deep/jellyfin"; - fsType = "nfs"; - options = nfsClientOpts; - }; -} diff --git a/modules/hosts/r5500/configuration.nix b/modules/hosts/r5500/configuration.nix index 1f6455a..c25db0d 100644 --- a/modules/hosts/r5500/configuration.nix +++ b/modules/hosts/r5500/configuration.nix @@ -17,7 +17,7 @@ ./_private/media-disk.nix ./_private/media-paths.nix ./_services/docker-media.nix - ./_services/nixdesk-nfs-client.nix + self.nixosModules.nixdeskJellyfin ./_services/jellyfin.nix ./_services/sonarr.nix ./_services/radarr.nix diff --git a/modules/system/nfs/default.nix b/modules/system/nfs/default.nix new file mode 100644 index 0000000..8a537c3 --- /dev/null +++ b/modules/system/nfs/default.nix @@ -0,0 +1,38 @@ +# NFS mount of nixdesk (14900k) bulk storage for clients. Exports live in +# modules/hosts/14900k/_private/jellyfin-nfs-export.nix +# +# Jellyfin library paths (see also jellyfin.nix): +# Movies → /mnt/nixdesk-jellyfin/movies +# Shows → /mnt/nixdesk-jellyfin/tv +# +# If you see "Stale file handle" under /mnt after changing exports or fsid on nixdesk, drop the +# old client mount and let automount reattach, e.g.: +# sudo umount -l /mnt/nixdesk-jellyfin +# ls /mnt/nixdesk-jellyfin +{ ... }: +{ + flake.nixosModules.nixdeskJellyfin = + { lib, ... }: + let + nfsExportHost = "192.168.2.25"; + # nfsvers+tcp: predictable Linux↔Linux; lookupcache=none: fewer stale dentries after export changes. + nfsClientOpts = [ + "rw" + "noatime" + "nofail" + "_netdev" + "nfsvers=3" + "tcp" + "lookupcache=none" + "x-systemd.automount" + "x-systemd.idle-timeout=3600" + ]; + in + { + fileSystems."/mnt/nixdesk-jellyfin" = { + device = "${nfsExportHost}:/mnt/deep/jellyfin"; + fsType = "nfs"; + options = nfsClientOpts; + }; + }; +}