30 lines
565 B
Nix
30 lines
565 B
Nix
{
|
|
lib,
|
|
config,
|
|
...
|
|
}:
|
|
let
|
|
inherit (lib) mkOption types;
|
|
in
|
|
{
|
|
options.vacu.nice = mkOption {
|
|
default = { };
|
|
type = types.attrsOf (types.ints.between (-20) 19);
|
|
};
|
|
|
|
config.vacu.nice.default = 0;
|
|
|
|
config.vacu.versionInfo.nice = config.vacu.nice;
|
|
|
|
config.vacu.assertions = [
|
|
{
|
|
assertion = config.vacu.nice ? default;
|
|
message = ''vacu.nice must have a "default"'';
|
|
}
|
|
{
|
|
assertion = !(config.vacu.nice ? default) || config.vacu.nice.default == 0;
|
|
message = ''vacu.nice.default must be set to 0'';
|
|
}
|
|
];
|
|
}
|