Files
nixconf/nfs-mount.nix
2025-07-24 15:48:46 +02:00

28 lines
599 B
Nix

{ config, pkgs, ... }: {
# Add NFS support to the initramfs so it can be mounted at boot.
boot.supportedFilesystems = [ "nfs" ];
services.cachefilesd = {
enable = true;
cacheDir = "/data/cache";
};
systemd.mounts = [{
type = "nfs";
mountConfig = {
Options = ["noatime" "fsc"];
};
what = "${config.vars.nfs_server}:${config.vars.nfs_volume}";
where = config.vars.nfs_mount;
}];
systemd.automounts = [{
wantedBy = [ "multi-user.target" ];
automountConfig = {
TimeoutIdleSec = "600";
};
where = config.vars.nfs_mount;
}];
}