fix(inventory/interface): use explizit file dependency, until dependency injection works properly
This commit is contained in:
@@ -35,6 +35,8 @@ in
|
||||
specialArgs = {
|
||||
inherit clan-core self;
|
||||
inherit (inputs) nixpkgs;
|
||||
# TODO: inject the inventory interface
|
||||
# inventoryInterface = {};
|
||||
};
|
||||
modules = [
|
||||
buildClanModule.flakePartsModule
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
{
|
||||
lib,
|
||||
nixpkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
flakePartsModule = {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
lib,
|
||||
self,
|
||||
# TODO: Use dependency injection to allow for testing
|
||||
# inventoryInterface,
|
||||
...
|
||||
}:
|
||||
let
|
||||
@@ -79,7 +81,7 @@ in
|
||||
};
|
||||
|
||||
inventory = lib.mkOption {
|
||||
type = types.submodule { imports = [ self.clanLib.inventory.interface ]; };
|
||||
type = types.submodule { imports = [ ../inventory/build-inventory/interface.nix ]; };
|
||||
description = ''
|
||||
The `Inventory` submodule.
|
||||
|
||||
@@ -128,6 +130,7 @@ in
|
||||
visible = false;
|
||||
# ClanInternals
|
||||
type = types.submodule {
|
||||
freeformType = types.attrsOf types.raw;
|
||||
options = {
|
||||
# Those options are interfaced by the CLI
|
||||
# We don't specify the type here, for better performance.
|
||||
|
||||
@@ -20,9 +20,8 @@ lib.fix (clanLib: {
|
||||
clan-core = self;
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
};
|
||||
buildClanModule = import ./build-clan {
|
||||
inherit lib nixpkgs;
|
||||
};
|
||||
buildClanModule = clanLib.callLib ./build-clan { inherit nixpkgs; };
|
||||
|
||||
buildClan = clanLib.buildClanModule.buildClanWith { clan-core = self; };
|
||||
# ------------------------------------
|
||||
# Lib functions that don't depend on 'self'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
inherit (import ./build-inventory { inherit lib clanLib; }) buildInventory;
|
||||
interface = ./build-inventory/interface.nix;
|
||||
mapInstances = clanLib.callLib ./distributed-service/inventory-adapter.nix {};
|
||||
mapInstances = clanLib.callLib ./distributed-service/inventory-adapter.nix { };
|
||||
# Returns the list of machine names
|
||||
# { ... } -> [ string ]
|
||||
resolveTags =
|
||||
|
||||
@@ -169,5 +169,6 @@ in
|
||||
grouped
|
||||
|
||||
allMachines
|
||||
importedModulesEvaluated;
|
||||
importedModulesEvaluated
|
||||
;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,8 @@ in
|
||||
specificMachineSettings = filterInternals res.importedModulesEvaluated.self-A.config.result.allMachines.jon.nixosModule.instance_foo.roles.peer.machines.jon.settings;
|
||||
|
||||
hasRoleSettings =
|
||||
res.importedModulesEvaluated.self-A.config.result.allMachines.jon.nixosModule.instance_foo.roles.peer ? settings;
|
||||
res.importedModulesEvaluated.self-A.config.result.allMachines.jon.nixosModule.instance_foo.roles.peer
|
||||
? settings;
|
||||
|
||||
# settings are specific.
|
||||
# Below we access:
|
||||
|
||||
Reference in New Issue
Block a user