Files
clan-core/lib/default.nix
DavHau 50cce90527 clan services: use service modules from clan-core by default
Users will use clan-core services first before making their own. Therefore this is a better default. Also it allow us to simplify rendering of our docs
2025-06-30 10:13:46 +00:00

55 lines
1.5 KiB
Nix

{
lib,
self,
...
}:
# Produces the
# 'clanLib' attribute set
# Wrapped with fix, so we can depend on other clanLib functions without passing the whole flake
lib.fix (
clanLib:
let
buildClanLib = (
clanLib.callLib ./modules {
clan-core = self;
}
);
in
{
inherit (buildClanLib)
buildClan
clan
;
/**
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);
evalService = clanLib.callLib ./modules/inventory/distributed-service/evalService.nix { };
# ------------------------------------
# ClanLib functions
evalClan = clanLib.callLib ./modules/inventory/eval-clan-modules { };
inventory = clanLib.callLib ./modules/inventory { clan-core = self; };
modules = clanLib.callLib ./modules/inventory/frontmatter { };
test = clanLib.callLib ./test { };
# Custom types
types = clanLib.callLib ./types { };
# Plain imports.
introspection = import ./introspection { inherit lib; };
jsonschema = import ./jsonschema { inherit lib; };
facts = import ./facts.nix { inherit lib; };
# flakes
flakes = clanLib.callLib ./flakes.nix {
clan-core = self;
};
# deprecated
# remove when https://git.clan.lol/clan/clan-core/pulls/3212 is implemented
inherit (self.inputs.nix-select.lib) select;
}
)