mirror of
https://github.com/NixOS/nix
synced 2025-06-28 05:21:16 +02:00
flakes: Ensure that self.outPath == ./.
Users expect `self` to refer to the directory where the `flake.nix` file resides.
This commit is contained in:
parent
532c70f531
commit
904a107d16
3 changed files with 86 additions and 2 deletions
|
@ -9,14 +9,18 @@ let
|
|||
(key: node:
|
||||
let
|
||||
|
||||
sourceInfo =
|
||||
rawSourceInfo =
|
||||
if key == lockFile.root
|
||||
then rootSrc
|
||||
else fetchTree (node.info or {} // removeAttrs node.locked ["dir"]);
|
||||
|
||||
subdir = if key == lockFile.root then rootSubdir else node.locked.dir or "";
|
||||
|
||||
flake = import (sourceInfo + (if subdir != "" then "/" else "") + subdir + "/flake.nix");
|
||||
outPath = rawSourceInfo + ((if subdir == "" then "" else "/") + subdir);
|
||||
|
||||
sourceInfo = rawSourceInfo // { inherit outPath; };
|
||||
|
||||
flake = import (outPath + "/flake.nix");
|
||||
|
||||
inputs = builtins.mapAttrs
|
||||
(inputName: inputSpec: allNodes.${resolveInput inputSpec})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue