22 lines
780 B
Nix
22 lines
780 B
Nix
{ pkgs, ... }:
|
|
{
|
|
# NFS client for /data/services
|
|
# Mounts from data-services.service.consul (Consul DNS for automatic failover)
|
|
# The NFS server registers itself in Consul, so this will automatically
|
|
# point to whichever host is currently running the NFS server
|
|
|
|
fileSystems."/data/services" = {
|
|
device = "data-services.service.consul:/persist/services";
|
|
fsType = "nfs";
|
|
options = [
|
|
"x-systemd.automount" # Auto-mount on access
|
|
"noauto" # Don't mount at boot (automount handles it)
|
|
"x-systemd.idle-timeout=60" # Unmount after 60s of inactivity
|
|
"_netdev" # Network filesystem (wait for network)
|
|
];
|
|
};
|
|
|
|
# Ensure NFS client packages are available
|
|
environment.systemPackages = [ pkgs.nfs-utils ];
|
|
}
|