build-clan: export default.nix that injects clanLib
This should be the single entry point, that includes clanLib instead of importApply propagation
This commit is contained in:
@@ -16,7 +16,7 @@ let
|
||||
localModuleSet ? { },
|
||||
}:
|
||||
(lib.evalModules {
|
||||
# TODO: remove clanLib from specialArgs
|
||||
# TODO: move clanLib from specialArgs to options
|
||||
specialArgs = {
|
||||
inherit clanLib;
|
||||
};
|
||||
|
||||
@@ -5,7 +5,14 @@ in
|
||||
{
|
||||
inherit (services) evalClanService mapInstances resolveModule;
|
||||
inherit (import ./build-inventory { inherit lib clanLib; }) buildInventory;
|
||||
interface = lib.modules.importApply ./build-inventory/interface.nix { inherit clanLib; };
|
||||
interface = {
|
||||
imports = [
|
||||
(import ./build-inventory/interface.nix { inherit clanLib; })
|
||||
];
|
||||
_module.args = {
|
||||
inherit clanLib;
|
||||
};
|
||||
};
|
||||
# Returns the list of machine names
|
||||
# { ... } -> [ string ]
|
||||
resolveTags =
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{clanLib}: {
|
||||
{ clanLib }:
|
||||
{
|
||||
_module.args = {
|
||||
inherit clanLib;
|
||||
};
|
||||
@@ -6,4 +7,4 @@
|
||||
./module.nix
|
||||
./interface.nix
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ clanLib }:
|
||||
{
|
||||
lib,
|
||||
clanLib,
|
||||
self,
|
||||
# TODO: Use dependency injection to allow for testing
|
||||
# inventoryInterface,
|
||||
|
||||
@@ -7,7 +7,7 @@ let
|
||||
eval = lib.evalModules {
|
||||
class = "nixos";
|
||||
modules = [
|
||||
(lib.modules.importApply ./clan/interface.nix { inherit clanLib; })
|
||||
(import ./clan/default.nix { inherit clanLib; })
|
||||
];
|
||||
};
|
||||
evalDocs = pkgs.nixosOptionsDoc {
|
||||
|
||||
@@ -18,7 +18,7 @@ module:
|
||||
;
|
||||
};
|
||||
modules = [
|
||||
(lib.modules.importApply ./clan/interface.nix { inherit (clan-core) clanLib; })
|
||||
(import ./clan/default.nix { inherit (clan-core) clanLib; })
|
||||
module
|
||||
{
|
||||
inherit specialArgs;
|
||||
|
||||
Reference in New Issue
Block a user