clanServices: remove unneeded self reference in lib
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
{
|
||||
lib,
|
||||
# TODO: Get rid of self here.
|
||||
# DONT add any new functions that depend on self here.
|
||||
# If a lib function depends on a piece in clan-core add that piece to the function arguments
|
||||
self,
|
||||
...
|
||||
}:
|
||||
@@ -31,7 +34,7 @@ lib.fix (
|
||||
# ------------------------------------
|
||||
# ClanLib functions
|
||||
evalClan = clanLib.callLib ./modules/inventory/eval-clan-modules { };
|
||||
inventory = clanLib.callLib ./modules/inventory { clan-core = self; };
|
||||
inventory = clanLib.callLib ./modules/inventory { };
|
||||
modules = clanLib.callLib ./modules/inventory/frontmatter { };
|
||||
test = clanLib.callLib ./test { };
|
||||
# Custom types
|
||||
|
||||
@@ -249,6 +249,7 @@ in
|
||||
distributedServices = clanLib.inventory.mapInstances {
|
||||
inherit (config) inventory;
|
||||
inherit localModuleSet flakeInputs;
|
||||
clanCoreModules = clan-core.clan.modules;
|
||||
prefix = [ "distributedServices" ];
|
||||
};
|
||||
machines = config.distributedServices.allMachines;
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
{
|
||||
lib,
|
||||
clanLib,
|
||||
clan-core,
|
||||
clanLib
|
||||
}:
|
||||
let
|
||||
services = clanLib.callLib ./distributed-service/inventory-adapter.nix {
|
||||
inherit clan-core;
|
||||
};
|
||||
services = clanLib.callLib ./distributed-service/inventory-adapter.nix { };
|
||||
in
|
||||
{
|
||||
inherit (services) mapInstances;
|
||||
|
||||
@@ -12,11 +12,10 @@
|
||||
{
|
||||
lib,
|
||||
clanLib,
|
||||
clan-core,
|
||||
...
|
||||
}:
|
||||
let
|
||||
resolveModule = import ./resolveModule.nix { inherit lib clan-core; };
|
||||
resolveModule = import ./resolveModule.nix { inherit lib; };
|
||||
in
|
||||
{
|
||||
mapInstances =
|
||||
@@ -26,6 +25,7 @@ in
|
||||
# The clan inventory
|
||||
inventory,
|
||||
localModuleSet,
|
||||
clanCoreModules,
|
||||
prefix ? [ ],
|
||||
}:
|
||||
let
|
||||
@@ -38,7 +38,7 @@ in
|
||||
resolvedModule = resolveModule {
|
||||
moduleSpec = instance.module;
|
||||
inherit localModuleSet;
|
||||
inherit flakeInputs;
|
||||
inherit flakeInputs clanCoreModules;
|
||||
};
|
||||
|
||||
# Every instance includes machines via roles
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
{ lib, clan-core }:
|
||||
{ lib }:
|
||||
{
|
||||
moduleSpec,
|
||||
flakeInputs,
|
||||
localModuleSet,
|
||||
clanCoreModules,
|
||||
}:
|
||||
let
|
||||
inputName = if moduleSpec.input == null then "<clan>" else moduleSpec.input;
|
||||
@@ -29,7 +30,7 @@ let
|
||||
let
|
||||
input =
|
||||
if moduleSpec.input == null then
|
||||
clan-core
|
||||
{ clan.modules = clanCoreModules; }
|
||||
else if moduleSpec.input == "self" then
|
||||
{ clan.modules = localModuleSet; }
|
||||
else
|
||||
|
||||
@@ -45,6 +45,7 @@ let
|
||||
inventory = evalInventory inventoryModule;
|
||||
in
|
||||
clanLib.inventory.mapInstances {
|
||||
clanCoreModules = { };
|
||||
flakeInputs = flakeInputsFixture;
|
||||
inherit inventory;
|
||||
localModuleSet = inventory.modules;
|
||||
|
||||
Reference in New Issue
Block a user