Merge pull request 'API(cli): add method to Flake class to allow calling nix functions' (#3502) from hsjobeki/clan-core:improvements-2 into main

Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3502
This commit is contained in:
hsjobeki
2025-05-05 20:16:28 +00:00
12 changed files with 185 additions and 56 deletions

View File

@@ -12,8 +12,10 @@ let
inventory,
directory,
flakeInputs,
prefix ? [ ],
}:
(lib.evalModules {
# TODO: remove clanLib from specialArgs
specialArgs = {
inherit clanLib;
};
@@ -24,13 +26,16 @@ let
# config.distributedServices.allMachines.${name} or [ ];
{ config, ... }:
{
distributedServices = clanLib.inventory.mapInstances {
inherit (config) inventory;
inherit flakeInputs;
prefix = prefix ++ [ "distributedServices" ];
};
machines = lib.mapAttrs (_machineName: v: {
machineImports = v;
}) config.distributedServices.allMachines;
}
)
(lib.modules.importApply ./inventory-introspection.nix { inherit clanLib; })