Add lib/import-flake.nix, a generic utility to import remote flakes via builtins.fetchTree instead of builtins.getFlake. It reuses local flake inputs where names match, only fetching missing inputs from the remote flake.lock. Follows references are resolved correctly so overridden inputs propagate into transitive dependencies. Add clan-community.inputs.<name> flake-parts options: .src - fetchTree-compatible attrset for the source .inputs - override specific inputs (merged on top of auto-matched) .out - resolved flake outputs (read-only)
23 lines
441 B
Nix
23 lines
441 B
Nix
{
|
|
lib,
|
|
...
|
|
}:
|
|
{
|
|
imports = [
|
|
../lib/inputs-module.nix
|
|
]
|
|
++ (
|
|
let
|
|
dirContents = builtins.readDir ./.;
|
|
|
|
validModuleDirs = builtins.filter (
|
|
name:
|
|
name != "result"
|
|
&& dirContents.${name} == "directory"
|
|
&& builtins.pathExists (./. + "/${name}/flake-module.nix")
|
|
) (builtins.attrNames dirContents);
|
|
in
|
|
map (name: ./. + "/${name}/flake-module.nix") validModuleDirs
|
|
);
|
|
}
|