From 663739a62938d0b79c386b62234bf250c5afb1a6 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Tue, 1 Apr 2025 11:04:51 +0200 Subject: [PATCH] feat(inventory): remove tag settings for now --- lib/distributed-service/flake-module.nix | 4 ++-- lib/distributed-service/inventory-adapter.nix | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/distributed-service/flake-module.nix b/lib/distributed-service/flake-module.nix index 1169311fa..52f6c7e68 100644 --- a/lib/distributed-service/flake-module.nix +++ b/lib/distributed-service/flake-module.nix @@ -14,7 +14,7 @@ in }: { # Run: nix-unit --extra-experimental-features flakes --flake .#legacyPackages.x86_64-linux. - 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 ''; diff --git a/lib/distributed-service/inventory-adapter.nix b/lib/distributed-service/inventory-adapter.nix index fde7bdfee..ad46957c8 100644 --- a/lib/distributed-service/inventory-adapter.nix +++ b/lib/distributed-service/inventory-adapter.nix @@ -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; }