feat(lib): init callLib; helper to bootstrap clanLib

This commit is contained in:
Johannes Kirschbauer
2025-03-30 16:11:04 +02:00
parent 89bc39869c
commit 40740860c0
2 changed files with 9 additions and 4 deletions

View File

@@ -13,6 +13,8 @@ lib.fix (clanLib: {
# We should reduce the dependency on 'self' aka the 'flake' object
# This makes it easier to test
# most of the time passing the whole flake is unnecessary
callLib = file: args: import file { inherit lib clanLib; } // args;
evalClan = import ./eval-clan-modules {
inherit lib;
clan-core = self;

View File

@@ -10,7 +10,9 @@ let
pathExists
;
in
{
rec {
# We should remove this.
# It would enforce treating at least 'lib' as a module in a whole
imports = filter pathExists [
./jsonschema/flake-module.nix
./inventory/flake-module.nix
@@ -18,9 +20,10 @@ in
./values/flake-module.nix
./distributed-service/flake-module.nix
];
flake.lib = import ./default.nix {
inherit lib inputs;
flake.clanLib = import ./default.nix {
inherit lib inputs self;
inherit (inputs) nixpkgs;
clan-core = self;
};
# TODO: remove this legacy alias
flake.lib = flake.clanLib;
}