From d0016e0990d677c618ae801b98c77ab5de37387e Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 8 May 2023 00:48:08 +0200 Subject: [PATCH] flake-parts-lib: Add importApply --- lib.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib.nix b/lib.nix index 0b9f6d9d..1424124b 100644 --- a/lib.nix +++ b/lib.nix @@ -216,6 +216,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