Inventory: init: deployment info for machines

This commit is contained in:
Johannes Kirschbauer
2024-07-16 13:56:53 +02:00
parent cfda89ef01
commit 9e6f2743e0
4 changed files with 20 additions and 2 deletions

View File

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

View File

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

View File

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

View File

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