mirror of
https://github.com/hercules-ci/flake-parts.git
synced 2025-03-16 21:38:24 +00:00
flake-parts-lib: Add importApply
This commit is contained in:
parent
f3e943c249
commit
d0016e0990
1 changed files with 8 additions and 0 deletions
8
lib.nix
8
lib.nix
|
@ -216,6 +216,14 @@ let
|
||||||
});
|
});
|
||||||
config = (mkAliasAndWrapDefsWithPriority (setAttrByPath to) fromOpt);
|
config = (mkAliasAndWrapDefsWithPriority (setAttrByPath to) fromOpt);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Helper function for importing while preserving module location. To be added
|
||||||
|
# in nixpkgs: https://github.com/NixOS/nixpkgs/pull/230588
|
||||||
|
# I expect these functions to remain identical. This one will stick around
|
||||||
|
# for a while to support older nixpkgs-lib.
|
||||||
|
importApply =
|
||||||
|
modulePath: staticArgs:
|
||||||
|
lib.setDefaultModuleLocation modulePath (import modulePath staticArgs);
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
Loading…
Add table
Reference in a new issue