mirror of
https://github.com/hercules-ci/flake-parts.git
synced 2024-12-14 11:47:31 +00:00
mkFlake: Set default module location
`outPath + "/flake.nix"` is technically an unfounded assumption, except almost all calls will be made from flake.nix. It surely is a lot better than `<unknown location>`.
This commit is contained in:
parent
b7405dad3f
commit
2cde01ee43
1 changed files with 9 additions and 1 deletions
10
lib.nix
10
lib.nix
|
@ -113,7 +113,15 @@ let
|
||||||
);
|
);
|
||||||
|
|
||||||
mkFlake = args: module:
|
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.
|
# For extending options in an already declared submodule.
|
||||||
# Workaround for https://github.com/NixOS/nixpkgs/issues/146882
|
# Workaround for https://github.com/NixOS/nixpkgs/issues/146882
|
||||||
|
|
Loading…
Reference in a new issue