46 lines
1.1 KiB
Nix
46 lines
1.1 KiB
Nix
{lib, ...}: let
|
|
pathPermissions = {
|
|
read = lib.mkEnableOption "should the path have read permissions";
|
|
write = lib.mkEnableOption "should the path have read permissions";
|
|
execute = lib.mkEnableOption "should the path have read permissions";
|
|
};
|
|
pathTypeSubmodule = {name, ...}: {
|
|
options = {
|
|
enable = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = true;
|
|
};
|
|
owner = {
|
|
user = lib.mkOption {
|
|
type = lib.types.str;
|
|
default = "nouser";
|
|
};
|
|
permissions = pathPermissions;
|
|
};
|
|
group = {
|
|
group = lib.mkOption {
|
|
type = lib.types.str;
|
|
default = "nogroup";
|
|
};
|
|
permissions = pathPermissions;
|
|
};
|
|
other = {
|
|
permissions = pathPermissions;
|
|
};
|
|
};
|
|
};
|
|
in {
|
|
imports = [
|
|
./dataset.nix
|
|
];
|
|
options = {
|
|
files = lib.types.mkOption {
|
|
type = lib.types.attrsOf (lib.types.submodule pathTypeSubmodule);
|
|
default = {};
|
|
};
|
|
directories = {
|
|
type = lib.types.attrsOf (lib.types.submodule pathTypeSubmodule);
|
|
default = {};
|
|
};
|
|
};
|
|
}
|