added more config to nfs
This commit is contained in:
parent
ade8d1ec83
commit
6d4cfec975
|
@ -25,6 +25,8 @@
|
||||||
systemd-boot.enable = true;
|
systemd-boot.enable = true;
|
||||||
efi.canTouchEfiVariables = true;
|
efi.canTouchEfiVariables = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
supportedFilesystems = ["nfs"];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems = {
|
fileSystems = {
|
||||||
|
@ -41,25 +43,64 @@
|
||||||
"/mnt/leyla_documents" = {
|
"/mnt/leyla_documents" = {
|
||||||
device = "defiant:/exports/leyla_documents";
|
device = "defiant:/exports/leyla_documents";
|
||||||
fsType = "nfs";
|
fsType = "nfs";
|
||||||
options = ["x-systemd.automount" "user" "noatime" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc"];
|
options = [
|
||||||
|
"x-systemd.automount"
|
||||||
|
"noauto"
|
||||||
|
"user"
|
||||||
|
"noatime"
|
||||||
|
"nofail"
|
||||||
|
"soft"
|
||||||
|
"x-systemd.idle-timeout=600"
|
||||||
|
"fsc"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
"/mnt/eve_documents" = {
|
"/mnt/eve_documents" = {
|
||||||
device = "defiant:/exports/eve_documents";
|
device = "defiant:/exports/eve_documents";
|
||||||
fsType = "nfs";
|
fsType = "nfs";
|
||||||
options = ["x-systemd.automount" "user" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc"];
|
options = [
|
||||||
|
"x-systemd.automount"
|
||||||
|
"noauto"
|
||||||
|
"user"
|
||||||
|
"nofail"
|
||||||
|
"soft"
|
||||||
|
"x-systemd.idle-timeout=600"
|
||||||
|
"fsc"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
"/mnt/users_documents" = {
|
"/mnt/users_documents" = {
|
||||||
device = "defiant:/exports/users_documents";
|
device = "defiant:/exports/users_documents";
|
||||||
fsType = "nfs";
|
fsType = "nfs";
|
||||||
options = ["x-systemd.automount" "user" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc"];
|
options = [
|
||||||
|
"x-systemd.automount"
|
||||||
|
"noauto"
|
||||||
|
"user"
|
||||||
|
"nofail"
|
||||||
|
"soft"
|
||||||
|
"x-systemd.idle-timeout=600"
|
||||||
|
"fsc"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
"/mnt/media" = {
|
"/mnt/media" = {
|
||||||
device = "defiant:/exports/media";
|
device = "defiant:/exports/media";
|
||||||
fsType = "nfs";
|
fsType = "nfs";
|
||||||
options = ["user" "noatime" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc"];
|
options = [
|
||||||
|
"x-systemd.automount"
|
||||||
|
"noauto"
|
||||||
|
"user"
|
||||||
|
"noatime"
|
||||||
|
"nofail"
|
||||||
|
"soft"
|
||||||
|
"x-systemd.idle-timeout=600"
|
||||||
|
"noatime"
|
||||||
|
"nodiratime"
|
||||||
|
"relatime"
|
||||||
|
"rsize=32768"
|
||||||
|
"wsize=32768"
|
||||||
|
"fsc"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -35,21 +35,51 @@
|
||||||
}
|
}
|
||||||
(
|
(
|
||||||
lib.mkIf (config.host.network_storage.nfs.enable && config.host.network_storage.enable) {
|
lib.mkIf (config.host.network_storage.nfs.enable && config.host.network_storage.enable) {
|
||||||
services.nfs.server = {
|
services.nfs = {
|
||||||
|
settings = {
|
||||||
|
nfsd = {
|
||||||
|
threads = 32;
|
||||||
|
port = config.host.network_storage.nfs.port;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
server = {
|
||||||
enable = true;
|
enable = true;
|
||||||
exports = lib.strings.concatLines (lib.lists.imap0 (
|
|
||||||
i: directory: "${directory._directory} 100.64.0.0/10(fsid=${toString i},rw,nohide,sync,no_subtree_check,crossmnt)"
|
lockdPort = 4001;
|
||||||
|
mountdPort = 4002;
|
||||||
|
statdPort = 4000;
|
||||||
|
|
||||||
|
exports = lib.strings.concatLines (
|
||||||
|
[
|
||||||
|
"${config.host.network_storage.export_directory} 100.64.0.0/10(rw,fsid=0,no_subtree_check)"
|
||||||
|
]
|
||||||
|
++ (
|
||||||
|
lib.lists.imap1 (
|
||||||
|
i: directory: "${directory._directory} 100.64.0.0/10(rw,fsid=${toString i},nohide,insecure,no_subtree_check)"
|
||||||
)
|
)
|
||||||
(
|
(
|
||||||
builtins.filter (
|
builtins.filter (
|
||||||
directory: lib.lists.any (target: target == directory.folder) config.host.network_storage.nfs.directories
|
directory: lib.lists.any (target: target == directory.folder) config.host.network_storage.nfs.directories
|
||||||
)
|
)
|
||||||
config.host.network_storage.directories
|
config.host.network_storage.directories
|
||||||
));
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
};
|
};
|
||||||
networking.firewall.interfaces.${config.services.tailscale.interfaceName}.allowedTCPPorts = [
|
};
|
||||||
|
networking.firewall.interfaces.${config.services.tailscale.interfaceName} = let
|
||||||
|
ports = [
|
||||||
|
111
|
||||||
config.host.network_storage.nfs.port
|
config.host.network_storage.nfs.port
|
||||||
|
config.services.nfs.server.lockdPort
|
||||||
|
config.services.nfs.server.mountdPort
|
||||||
|
config.services.nfs.server.statdPort
|
||||||
|
20048
|
||||||
];
|
];
|
||||||
|
in {
|
||||||
|
allowedTCPPorts = ports;
|
||||||
|
allowedUDPPorts = ports;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue