Open
Description
Describe the bug
In a repo setup as follows:
.
├── flake.lock
├── flake.nix
└── sub-flake
├── flake.lock
└── flake.nix
where sub-flake/flake.nix
refers to top level flake with:
inputs = {
parent.url = ./..;
};
when new input
is added to top level flake the sub-flake breaks (fails to evaluate)
Steps To Reproduce
- start with a repo structure as shown in this commit
- make changes as shown in this commit
- run:
cd sub-flake
nix eval .#lib.one
which should print the following error:
error:
… in the left operand of the update (//) operator
at «nix-internal»/call-flake.nix:77:9:
76| # This is shadowed in the next //
77| // sourceInfo
| ^
78| // {
… from call site
at «nix-internal»/call-flake.nix:68:17:
67|
68| outputs = flake.outputs (inputs // { self = result; });
| ^
69|
error: function 'outputs' called without required argument 'nixpkgs-lib-2'
at /nix/store/k84vy37d2qlmagax150drp642klmlgc4-source/flake.nix:10:5:
9| outputs =
10| { nixpkgs-lib, nixpkgs-lib-2, ... }:
| ^
11| {
This can be fixed by updating sub-flake/flake.lock
by running the following from sub-flake
dir:
nix flake update parent
as seen in this commit
Expected behavior
The sub-flake should not need to be updated since all necessary details are already present in the parents flake, so it should simply read the info from there.
Metadata
Additional context
- Possible solution strategy: Reuse input lock files #7730
- a simpler, small scope solution may also be possible instead (but wouldn't improve laziness in the remote input case)
Checklist
- checked latest Nix manual (source)
- checked open bug issues and pull requests for possible duplicates
Add 👍 to issues you find important.