35 lines
821 B
Nix
35 lines
821 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,no_subtree_check)
|
|
'';
|
|
statdPort = 4000;
|
|
lockdPort = 4001;
|
|
mountdPort = 4002;
|
|
};
|
|
};
|
|
}
|