Files
nix-stuff/common/nice-option.nix
Shelvacu 61a442dd42 wip nice
2025-01-31 15:45:47 -08:00

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'';
}
];
}