machines-config/nixosModules/services/nfs/default.nix
2025-01-16 19:16:30 +01:00

35 lines
804 B
Nix

{
config,
lib,
...
}:
let
cfg = config.kropcloud.services.nfs;
kc_cfg = config.kropcloud;
in
{
options.kropcloud.services.nfs = {
enable = lib.mkEnableOption "Whence to enable nfs service.";
exportDirectory = lib.mkOption {
type = lib.types.str;
default = "/mnt/nas";
description = "The directory to export.";
};
clusterWildcard = lib.mkOption {
type = lib.types.str;
default = "*";
description = "The wildcard to use for cluster.";
};
};
config = lib.mkIf cfg.enable {
services.nfs.server = {
enable = true;
exports = ''
${cfg.exportDirectory} ${cfg.clusterWildcard}(rw,sync,no_wdelay,no_root_squash,insecure)
'';
statdPort = 4000;
lockdPort = 4001;
mountdPort = 4002;
};
};
}