Files
clan-core/lib/default.nix
Johannes Kirschbauer ce84c4cddb chore(lib/modulesDocs): move dependency on clan-core and pkgs into function args
This is a good idea, to make lib agnostic from clan-core
The next step could be to rename the clan-core argument name
Or to explizitly pass the actual dependencies, instead of everything in
clan-core
2025-04-08 15:30:49 +02:00

32 lines
1.0 KiB
Nix

{
lib,
self,
nixpkgs,
nix-darwin ? null,
...
}:
# Produces the
# 'clanLib' attribute set
# Wrapped with fix, so we can depend on other clanLib functions without passing the whole flake
lib.fix (clanLib: {
/**
Like callPackage, but doesn't try to automatically detect arguments
'lib' and 'clanLib' are always passed, plus the additional arguments
*/
callLib = file: args: import file ({ inherit lib clanLib; } // args);
buildClan = clanLib.buildClanModule.buildClanWith { clan-core = self; };
# ------------------------------------
# ClanLib functions
evalClan = clanLib.callLib ./inventory/eval-clan-modules { };
buildClanModule = clanLib.callLib ./build-clan { inherit nixpkgs nix-darwin; };
inventory = clanLib.callLib ./inventory { };
modules = clanLib.callLib ./inventory/frontmatter { };
# Plain imports.
values = import ./introspection { inherit lib; };
jsonschema = import ./jsonschema { inherit lib; };
select = import select/default.nix;
facts = import ./facts.nix { inherit lib; };
})