config/profiles/mounts/meconium-nfs.nix
2025-01-25 03:10:56 +01:00

35 lines
991 B
Nix

{ config, pkgs, lib, ... }:
# TODO: use tailscale if enabled
{
# TODO: wireguard
#boot.kernelParams = [ "nfs.nfs4_disable_idmapping=0" "nfsd.nfs4_disable_idmapping=0" ];
# https://wiki.nixos.org/wiki/NFS
fileSystems = let
mkMount = mountpoint: server: subdir: {
"${mountpoint}${subdir}" = {
device = "${server}${subdir}";
fsType = "nfs";
#options = [ "nfsvers=4.2" ];
};
};
# TODO: combine nameValuePair and listToAttrs
joinSets = sets: builtins.foldl' (l: r: l // r) {} sets;
# TODO: space in dirname is not supported
in joinSets (map (mkMount "/mnt/meconium" "192.168.1.9:/mnt/meconium" ) [
/* in joinSets (map (mkMount "/mnt/meconium" "noximilien.tail9aac63.ts.net:/mnt/meconium" ) [ */
/* in joinSets (map (mkMount "/mnt/meconium" "100.113.27.44:/mnt/meconium" ) [ */
""
"/Backups"
"/Backups/rocm.pbsds.net"
"/blob"
"/blob/attic"
#"/garage"
#"/garage/gunktrunk"
]);
}