From b05e15926ad384a3e19ecf8531f3244276b2de1f Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Sat, 25 Oct 2025 15:44:31 +0200 Subject: [PATCH] autofs fix --- hosts/nixos/thinkpad/system.nix | 1 - modules/autofs.nix | 9 ++------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/hosts/nixos/thinkpad/system.nix b/hosts/nixos/thinkpad/system.nix index 1bc9756..6ae1341 100644 --- a/hosts/nixos/thinkpad/system.nix +++ b/hosts/nixos/thinkpad/system.nix @@ -323,7 +323,6 @@ enable = true; remoteHost = "lan.hs.yanlincs.com"; # Prefer LAN when at home replicas = [ "10.2.2.20" ]; # Fallback to WireGuard when remote - remotePath = "/mnt/storage/Media"; mountPoint = "/mnt/hs-media"; }; diff --git a/modules/autofs.nix b/modules/autofs.nix index 12b5ec3..50800b4 100644 --- a/modules/autofs.nix +++ b/modules/autofs.nix @@ -15,11 +15,6 @@ in description = "Primary remote NFS server hostname or IP"; }; - remotePath = mkOption { - type = types.str; - description = "Remote path to mount"; - }; - mountPoint = mkOption { type = types.str; description = "Local mount point"; @@ -36,8 +31,8 @@ in let # Build server list: primary host followed by replicas allHosts = [ cfg.remoteHost ] ++ cfg.replicas; - # Format as "host1,host2,host3:/path" for NFS replicas - locations = "${concatStringsSep "," allHosts}:${cfg.remotePath}"; + # For NFSv4 with fsid=0, the exported path becomes root, so mount as "/" + locations = "${concatStringsSep "," allHosts}:/"; in { services.autofs = {