Files
nixconf/nfs-mount.nix
T
2026-01-24 11:20:47 +01:00

36 lines
734 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";
extraConfig = ''
brun 10%
bcull 7%
bstop 3%
frun 10%
fcull 7%
fstop 3%
'';
};
systemd.mounts = [{
type = "nfs";
mountConfig = {
Options = ["noatime" "fsc" "actimeo=3600" ];
};
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;
}];
}