Inventory: init: deployment info for machines

This commit is contained in:
Johannes Kirschbauer 2024-07-16 13:56:53 +02:00
parent 2947f64f3a
commit ac95878ead
Signed by: hsjobeki
SSH Key Fingerprint: SHA256:vX3utDqig7Ph5L0JPv87ZTPb/w7cMzREKVZzzLFg9qU
4 changed files with 20 additions and 2 deletions

View File

@ -120,8 +120,8 @@ in
machines
pkgsForSystem
meta
inventory
;
inventory = (lib.traceValSeq cfg.inventory);
};
};
_file = __curPos.file;

View File

@ -72,6 +72,13 @@ let
"nixpkgs"
"hostSystem"
] null config;
deploymentInfo.targetHost = lib.attrByPath [
"clan"
"core"
"networking"
"targetHost"
] null config;
}
) machines;
}

View File

@ -24,7 +24,7 @@ let
availableTags = lib.foldlAttrs (
acc: _: v:
v.tags or [ ] ++ acc
) [ ] (lib.traceValSeq inventory.machines);
) [ ] (inventory.machines);
tagMembers = builtins.attrNames (
lib.filterAttrs (_n: v: builtins.elem tag v.tags or [ ]) inventory.machines

View File

@ -49,6 +49,17 @@ in
default = null;
type = types.nullOr types.str;
};
deploymentInfo = lib.mkOption {
default = { };
type = types.submodule {
options = {
targetHost = lib.mkOption {
default = null;
type = types.nullOr types.str;
};
};
};
};
};
}
);