Skip to content

Commit

Permalink
Merge pull request #149 from hercules-ci/importApply
Browse files Browse the repository at this point in the history
flake-parts-lib: Add importApply
  • Loading branch information
roberth authored May 8, 2023
2 parents 5beafef + d0016e0 commit 2e844a6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,14 @@ let
});
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
Expand Down

0 comments on commit 2e844a6

Please sign in to comment.