From 018f18a93ecd388f950a04f6fb2fb7272495954d Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Mon, 15 Jul 2024 15:59:59 +0200 Subject: [PATCH] Inventory: fix roles config --- inventory.json | 5 ++++- lib/inventory/build-inventory/default.nix | 15 ++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/inventory.json b/inventory.json index 478f177c7..3929343b5 100644 --- a/inventory.json +++ b/inventory.json @@ -19,7 +19,10 @@ }, "roles": { "default": { - "machines": ["minimal-inventory-machine"] + "machines": ["minimal-inventory-machine"], + "config": { + "packages": ["vim"] + } } }, "machines": { diff --git a/lib/inventory/build-inventory/default.nix b/lib/inventory/build-inventory/default.nix index 3b9a35b5d..c0e9852da 100644 --- a/lib/inventory/build-inventory/default.nix +++ b/lib/inventory/build-inventory/default.nix @@ -85,8 +85,7 @@ let ) inverseRoles.${machineName} or [ ]; roleServiceConfigs = builtins.map ( - role: - serviceConfig.roles.${role}.config or { } + role: serviceConfig.roles.${role}.config or { } ) inverseRoles.${machineName} or [ ]; in if isInService then @@ -94,11 +93,13 @@ let ++ [ { imports = [ clan-core.clanModules.${moduleName} ] ++ roleModules; - config.clan.${moduleName} = lib.mkMerge [ - globalConfig - machineServiceConfig - roleServiceConfigs - ]; + config.clan.${moduleName} = lib.mkMerge ( + [ + globalConfig + machineServiceConfig + ] + ++ roleServiceConfigs + ); } { config.clan.inventory.services.${moduleName}.${instanceName} = {