diff --git a/lib/modules/inventory/distributed-service/service-module.nix b/lib/modules/inventory/distributed-service/service-module.nix index 13ae05355..87ec23b0d 100644 --- a/lib/modules/inventory/distributed-service/service-module.nix +++ b/lib/modules/inventory/distributed-service/service-module.nix @@ -97,11 +97,6 @@ let inherit (v) settings; }).config; }) role.machines; - settings = - (evalMachineSettings { - inherit roleName instanceName; - inherit (role) settings; - }).config; }) instance.roles; in { @@ -446,15 +441,12 @@ in }; # ... }; - settings = { - timeout = 30; - }; }; # ... }; ``` - - `settings`: The settings of the role, as defined in `instances` + - `settings`: The settings of the current machine, as defined in `instances` ```nix { timeout = 30; diff --git a/lib/modules/inventory/distributed-service/tests/per_instance_args.nix b/lib/modules/inventory/distributed-service/tests/per_instance_args.nix index a9bdd87b7..9b54ddbb5 100644 --- a/lib/modules/inventory/distributed-service/tests/per_instance_args.nix +++ b/lib/modules/inventory/distributed-service/tests/per_instance_args.nix @@ -123,9 +123,6 @@ in }; expected = { instanceName = "instance_foo"; - settings = { - timeout = "foo-peer-jon"; - }; machine = { name = "jon"; roles = [ @@ -137,12 +134,9 @@ in controller = { machines = { jon = { - settings = { - }; + settings = { }; }; }; - settings = { - }; }; peer = { machines = { @@ -152,11 +146,11 @@ in }; }; }; - settings = { - timeout = "foo-peer"; - }; }; }; + settings = { + timeout = "foo-peer-jon"; + }; }; }; diff --git a/lib/modules/inventory/distributed-service/tests/per_machine_args.nix b/lib/modules/inventory/distributed-service/tests/per_machine_args.nix index 5d9a11392..8e378a06d 100644 --- a/lib/modules/inventory/distributed-service/tests/per_machine_args.nix +++ b/lib/modules/inventory/distributed-service/tests/per_machine_args.nix @@ -70,8 +70,6 @@ let roles.peer.tags.all = { }; }; }; - - filterInternals = lib.filterAttrs (n: _v: !lib.hasPrefix "_" n); in { @@ -89,7 +87,8 @@ in # instance = instance_foo # roles = peer # machines = jon - specificMachineSettings = filterInternals res.importedModulesEvaluated.self-A.result.allMachines.jon.passthru.instances.instance_foo.roles.peer.machines.jon.settings; + specificMachineSettings = + res.importedModulesEvaluated.self-A.result.allMachines.jon.passthru.instances.instance_foo.roles.peer.machines.jon.settings; hasRoleSettings = res.importedModulesEvaluated.self-A.result.allMachines.jon.passthru.instances.instance_foo.roles.peer @@ -100,16 +99,21 @@ in # instance = instance_foo # roles = peer # machines = * - specificRoleSettings = filterInternals res.importedModulesEvaluated.self-A.result.allMachines.jon.passthru.instances.instance_foo.roles.peer.settings; + specificRoleSettings = + res.importedModulesEvaluated.self-A.result.allMachines.jon.passthru.instances.instance_foo.roles.peer; }; - expected = { + expected = rec { hasMachineSettings = true; + hasRoleSettings = false; specificMachineSettings = { timeout = "foo-peer-jon"; }; - hasRoleSettings = true; specificRoleSettings = { - timeout = "foo-peer"; + machines = { + jon = { + settings = specificMachineSettings; + }; + }; }; }; };