Files
clan-core/lib/default.nix
Jörg Thalheim 8d4099d13d refactor: move docs transformOptions to clanLib to reduce rebuilds
- Add clanLib.docs.stripStorePathsFromDeclarations to deduplicate code
- Update all documentation generation to use the shared function
- This strips store paths from option declarations to prevent options.json
  from rebuilding when only store paths change but content remains the same
- Reduces unnecessary documentation rebuilds when making unrelated changes
2025-07-09 16:59:58 +02:00

54 lines
1.6 KiB
Nix

{
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,
...
}:
# 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 { };
modules = clanLib.callLib ./modules/inventory/frontmatter { };
test = clanLib.callLib ./test { };
flake-inputs = clanLib.callLib ./flake-inputs.nix { };
# Custom types
types = clanLib.callLib ./types { };
# Plain imports.
introspection = import ./introspection { inherit lib; };
jsonschema = import ./jsonschema { inherit lib; };
facts = import ./facts.nix { inherit lib; };
docs = import ./docs.nix { inherit lib; };
# flakes
flakes = clanLib.callLib ./flakes.nix { };
}
)