1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-02 15:11:00 +01:00

Don't allow flake inputs to have both a flakeref and a follows

Having both doesn't make sense so it's best to disallow it. If this
causes issues we could turn into a warning.
This commit is contained in:
Eelco Dolstra 2025-06-12 20:38:51 +02:00
parent 9a18a11d7d
commit 6999183956
2 changed files with 15 additions and 1 deletions

View file

@ -154,6 +154,9 @@ static FlakeInput parseFlakeInput(
input.ref = parseFlakeRef(state.fetchSettings, *url, {}, true, input.isFlake, true);
}
if (input.ref && input.follows)
throw Error("flake input has both a flake reference and a follows attribute, at %s", state.positions[pos]);
return input;
}