Files
config/profiles/mounts/panorama-nfs.nix
T
2025-07-15 22:43:24 +02:00

48 lines
1.2 KiB
Nix

{
config,
pkgs,
lib,
...
}:
{
# in base.nix: imports = [ ./common-nfs.nix ];
# TODO: wireguard
#boot.kernelParams = [ "nfs.nfs4_disable_idmapping=0" "nfsd.nfs4_disable_idmapping=0" ];
# https://wiki.nixos.org/wiki/NFS
# don't mount if local VM
config = lib.mkIf (!config.virtualisation.isVmVariant) {
fileSystems =
let
mkMount = mountpoint: server: subdir: {
"${mountpoint}${subdir}" = {
device = "${server}${subdir}";
fsType = "nfs";
options = [ "nfsvers=4.2" ] ++ config.pbsds.nfs-lazy-mount.nfsOptions;
depends = lib.mkIf (subdir != "") [
(builtins.dirOf "${mountpoint}${subdir}")
];
};
};
in
lib.mkMerge (
# map (mkMount "/mnt/panorama" "eple.pbsds.net:/mnt/panorama" ) [
# map (mkMount "/mnt/panorama" "100.82.36.23:/mnt/panorama" ) [
map (mkMount "/mnt/panorama" "eple.tail9aac63.ts.net:/mnt/panorama") [
# TODO: spaces in dirname is not supported
""
"/Backups"
"/Bart"
"/Datasets"
"/Public"
"/Syncthing"
]
);
};
}