NFS server and client setup.
This commit is contained in:
21
common/nfs-services-client.nix
Normal file
21
common/nfs-services-client.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ 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 ];
|
||||
}
|
||||
Reference in New Issue
Block a user