1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2024-12-14 11:47:31 +00:00

Merge pull request #91 from hercules-ci/default-module-location

mkFlake: Set default module location
This commit is contained in:
Robert Hensing 2022-12-27 10:26:03 +01:00 committed by GitHub
commit 6b2d46d9ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

10
lib.nix
View file

@ -113,7 +113,15 @@ let
);
mkFlake = args: module:
(flake-parts-lib.evalFlakeModule args module).config.flake;
let
loc =
if args?inputs.self.outPath
then args.inputs.self.outPath + "/flake.nix"
else "<mkFlake argument>";
mod = lib.setDefaultModuleLocation loc module;
eval = flake-parts-lib.evalFlakeModule args mod;
in
eval.config.flake;
# For extending options in an already declared submodule.
# Workaround for https://github.com/NixOS/nixpkgs/issues/146882