{ config, lib, vars, ... }: { fileSystems.${vars.raspiMountpoint} = { device = "${vars.raspberryPiHost}.${vars.tailnetDomain}:${vars.raspiNfsPath}"; fsType = "nfs4"; options = [ "nofail" "_netdev" "noatime" # Explicitly use NFSv4.2 if supported "nfsvers=4.2" ] ++ lib.optionals (!config.boot.isContainer) [ # `x-systemd.automount` never works inside a Linux container (LXC # included) -- confirmed live on lxc-docker: systemd logs "Starting # of .automount unsupported" and never mounts it. `nofail` # above already keeps boot non-blocking there, so plain eager # mounting is fine. # Don't mount until first access "x-systemd.automount" # Unmount after 10 min idle "x-systemd.idle-timeout=600" # Give the Pi/Tailscale a little time to appear "x-systemd.device-timeout=10s" ]; }; }