feat: stuff

This commit is contained in:
2026-08-26 09:04:34 +02:00
parent 754bd6bc06
commit 07c7c3b3f8
8 changed files with 133 additions and 10 deletions
+39
View File
@@ -0,0 +1,39 @@
{
lib,
config,
...
}:
with lib;
let
cfg = config.services.nfsclient;
in
{
options.services.nfsclient = {
enable = mkEnableOption "Enable shared directory";
ip = mkOption {
type = types.str;
};
exportedDirs = mkOption {
type = types.listOf types.str;
};
};
config = mkIf cfg.enable {
boot.supportedFilesystems = [ "nfs" ];
fileSystems = builtins.listToAttrs (
lib.map (dir: {
name = "/mnt/${dir}";
value = {
device = "${cfg.ip}:/shared";
fsType = "nfs4";
options = [
"x-systemd.idle-timeout=600"
"x-systemd.automount"
"noauto"
];
};
}) cfg.exportedDirs
);
};
}