mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2026-10-06 05:31:55 +00:00
feat: stuff
This commit is contained in:
@@ -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
|
||||
);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user