feat(inventory): remove tag settings for now

This commit is contained in:
Johannes Kirschbauer
2025-04-01 11:04:51 +02:00
parent ae8e7edac0
commit 663739a629
2 changed files with 11 additions and 9 deletions

View File

@@ -14,7 +14,7 @@ in
}:
{
# Run: nix-unit --extra-experimental-features flakes --flake .#legacyPackages.x86_64-linux.<attrName>
legacyPackages.evalTest-distributedServices = import ./tests {
legacyPackages.evalTests-distributedServices = import ./tests {
inherit lib self;
};
@@ -24,7 +24,7 @@ in
nix-unit --eval-store "$HOME" \
--extra-experimental-features flakes \
${inputOverrides} \
--flake ${self}#legacyPackages.${system}.evalTest-distributedServices
--flake ${self}#legacyPackages.${system}.evalTests-distributedServices
touch $out
'';

View File

@@ -54,7 +54,7 @@ let
) [ ] members.tags or [ ]);
};
machineHasTag = machineName: tagName: lib.elem tagName inventory.machines.${machineName}.tags;
# machineHasTag = machineName: tagName: lib.elem tagName inventory.machines.${machineName}.tags;
# map the instances into the module
importedModuleWithInstances = lib.mapAttrs (
@@ -119,9 +119,12 @@ let
machineName:
let
machineSettings = instance.roles.${roleName}.machines.${machineName}.settings or { };
settingsViaTags = lib.filterAttrs (
tagName: _: machineHasTag machineName tagName
) instance.roles.${roleName}.tags;
# TODO: tag settings
# Wait for this feature until option introspection for 'settings' is done.
# This might get too complex to handle otherwise.
# settingsViaTags = lib.filterAttrs (
# tagName: _: machineHasTag machineName tagName
# ) instance.roles.${roleName}.tags;
in
{
# TODO: Do we want to wrap settings with
@@ -129,7 +132,7 @@ let
settings = {
imports = [
machineSettings
] ++ lib.attrValues (lib.mapAttrs (_tagName: v: v.settings) settingsViaTags);
]; # ++ lib.attrValues (lib.mapAttrs (_tagName: v: v.settings) settingsViaTags);
};
}
);
@@ -194,6 +197,5 @@ let
) { } evals;
in
{
inherit importedModuleWithInstances grouped;
inherit evals allMachines;
inherit importedModuleWithInstances grouped evals allMachines;
}