mirror of
https://github.com/hercules-ci/flake-parts.git
synced 2024-12-14 11:47:31 +00:00
Merge pull request #149 from hercules-ci/importApply
flake-parts-lib: Add importApply
This commit is contained in:
commit
2e844a66a7
1 changed files with 8 additions and 0 deletions
8
lib.nix
8
lib.nix
|
@ -218,6 +218,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…
Reference in a new issue