Flake registry entries can overlap with fully-qualified flake inputs #181
Labels
No labels
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/store
bug
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
RFD
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
ux
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#181
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When adding something to the flake registry, the order of arguments is
nix registry add <from-url> <to-url>
and this is quite literal,<from-url>
may be any string input. This means you can specify nonsensical things such asnix registry add github:nixos/nixpkgs nixpkgs
which will add an indirect flake reference for the namegithub:nixos/nixpkgs
that points to an unspecifiednixpkgs
indirect reference. If you then correct this by flipping those arguments without removing the previously added entry, you end up with a loop if you try to reference either.This is completely insane behavior that I cannot imagine ever wanting, and while I have not tested thoroughly, I believe this is essentially never what a user wants, even for an overridden input I think this only half works due to how flakes are resolved though it's possible this can be used to add a permanent override for flakes not using registry references.
See also: #170
do we also want to ban <from-url> values like
flake:nixpkgs
? banning these fully-qualified but indirect urls that flake ids desugar to may improve our protection against swapping the arguments.similarly do we want to ban flake ids with branch like
nixpkgs/nixos-20.03
? this one’s probably not as important, and banning it would break one of the help examples.https://gerrit.lix.systems/c/lix/+/1494
This issue was mentioned on Gerrit on the following CLs:
nix registry add
")