{ config, vars, ... }: let # Use the same FQDN approach as docker/mount-data.nix — a bare hostname is # unreliable: systemd-resolved only tries LLMNR for single-label names, and # a global search domain causes it to skip the interface-scoped LAN DNS. nfsServer = "${vars.nfsServerHost}.${vars.homeDomain}"; # x-systemd.automount is unsupported inside LXC containers (systemd logs # "Starting of .automount unsupported" and never mounts). Use nofail # there so a boot with the NFS server unreachable doesn't hang instead. automountOpts = if config.boot.isContainer then [ "nofail" ] else [ "x-systemd.automount" ]; in { fileSystems.${vars.nfsShares.proxmoxPxeImages.mountpoint} = { device = "${nfsServer}:${vars.storageRoot}/${vars.nfsShares.proxmoxPxeImages.subpath}"; fsType = "nfs"; options = [ "nfsvers=4.2" "_netdev" "noatime" ] ++ automountOpts; }; }