autofs fix

This commit is contained in:
Yan Lin 2025-10-25 15:44:31 +02:00
parent 7ed7224d53
commit b05e15926a
2 changed files with 2 additions and 8 deletions

View file

@ -323,7 +323,6 @@
enable = true; enable = true;
remoteHost = "lan.hs.yanlincs.com"; # Prefer LAN when at home remoteHost = "lan.hs.yanlincs.com"; # Prefer LAN when at home
replicas = [ "10.2.2.20" ]; # Fallback to WireGuard when remote replicas = [ "10.2.2.20" ]; # Fallback to WireGuard when remote
remotePath = "/mnt/storage/Media";
mountPoint = "/mnt/hs-media"; mountPoint = "/mnt/hs-media";
}; };

View file

@ -15,11 +15,6 @@ in
description = "Primary remote NFS server hostname or IP"; description = "Primary remote NFS server hostname or IP";
}; };
remotePath = mkOption {
type = types.str;
description = "Remote path to mount";
};
mountPoint = mkOption { mountPoint = mkOption {
type = types.str; type = types.str;
description = "Local mount point"; description = "Local mount point";
@ -36,8 +31,8 @@ in
let let
# Build server list: primary host followed by replicas # Build server list: primary host followed by replicas
allHosts = [ cfg.remoteHost ] ++ cfg.replicas; allHosts = [ cfg.remoteHost ] ++ cfg.replicas;
# Format as "host1,host2,host3:/path" for NFS replicas # For NFSv4 with fsid=0, the exported path becomes root, so mount as "/"
locations = "${concatStringsSep "," allHosts}:${cfg.remotePath}"; locations = "${concatStringsSep "," allHosts}:/";
in in
{ {
services.autofs = { services.autofs = {