cluster/lib: implement config.lib.forService for better option filtering
This commit is contained in:
parent
bbe3373c2e
commit
b6e0390555
2 changed files with 13 additions and 0 deletions
|
@ -17,6 +17,7 @@ lib.evalModules {
|
|||
./lib/mesh.nix
|
||||
./lib/secrets.nix
|
||||
./lib/testing.nix
|
||||
./lib/lib.nix
|
||||
|
||||
./import-services.nix
|
||||
];
|
||||
|
|
12
cluster/lib/lib.nix
Normal file
12
cluster/lib/lib.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
options.lib = {
|
||||
forService = lib.mkOption {
|
||||
description = "Enable these definitions for a particular service only.";
|
||||
type = lib.types.functionTo lib.types.raw;
|
||||
readOnly = true;
|
||||
default = service: lib.mkIf (!config.simulacrum || lib.any (s: s == service) config.testConfig.activeServices);
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue