Added options to nfs share and root

This commit is contained in:
Nathan Anderson 2024-03-18 09:53:08 -06:00
parent 4f8c9c85aa
commit 3d71ee0bf8
2 changed files with 17 additions and 6 deletions

View File

@ -18,6 +18,8 @@
email = email; email = email;
sshEnable = true; sshEnable = true;
nfsEnable = true; nfsEnable = true;
nfsRoot = "/nfs_export";
nfsExports = [ "/kage" ];
}; };
# deskCfg = { # deskCfg = {

View File

@ -27,6 +27,14 @@ in
nfsEnable = lib.mkOption { nfsEnable = lib.mkOption {
default = false; default = false;
}; };
nfsRoot = lib.mkOption {
default = "/nfs_export";
type = lib.types.str;
};
nfsExports = lib.mkOption {
default = [];
description = "List of file paths provided as strings to the nfs exports";
};
}; };
imports = [ imports = [
@ -73,7 +81,8 @@ in
services.nfs.server = lib.mkIf srvConfig.nfsEnable { services.nfs.server = lib.mkIf srvConfig.nfsEnable {
enable = true; enable = true;
exports = '' exports = ''
/kage 192.168.1.149(rw,fsid=0,no_subtree_check) ${srvConfig.nfsRoot} 192.168.1.*(rw,fsid=root,no_subtree_check)
${concatMapStringsSep "\n" (n: "${srvConfig.nfsRoot}${n} 192.168.1.*(rw,no_subtree_check,nohide)") srvConfig.nfsExports}
''; '';
}; };