mirror of
https://github.com/hercules-ci/flake-parts.git
synced 2025-03-16 21:38:24 +00:00
Merge pull request #91 from hercules-ci/default-module-location
mkFlake: Set default module location
This commit is contained in:
commit
6b2d46d9ab
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…
Add table
Reference in a new issue