Merge pull request 'Inventory/constraints improve observability' (#2400) from hsjobeki/clan-core:hsjobeki-main into main
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
imports = [
|
||||
./backups.nix
|
||||
./facts
|
||||
./inventory/interface.nix
|
||||
./inventory
|
||||
./manual.nix
|
||||
./meta/interface.nix
|
||||
./metadata.nix
|
||||
|
||||
6
nixosModules/clanCore/inventory/default.nix
Normal file
6
nixosModules/clanCore/inventory/default.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
imports = [
|
||||
./interface.nix
|
||||
./implementation.nix
|
||||
];
|
||||
}
|
||||
6
nixosModules/clanCore/inventory/implementation.nix
Normal file
6
nixosModules/clanCore/inventory/implementation.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
config.assertions = builtins.attrValues (
|
||||
builtins.mapAttrs (_id: value: value // { inherit _id; }) config.clan.inventory.assertions
|
||||
);
|
||||
}
|
||||
@@ -60,4 +60,22 @@ in
|
||||
'';
|
||||
type = lib.types.attrsOf (lib.types.attrsOf instanceOptions);
|
||||
};
|
||||
options.clan.inventory.assertions = lib.mkOption {
|
||||
default = { };
|
||||
internal = true;
|
||||
visible = false;
|
||||
type = lib.types.attrsOf (
|
||||
# TODO: use NixOS upstream type
|
||||
lib.types.submodule {
|
||||
options = {
|
||||
assertion = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
};
|
||||
message = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user