on some derivations, the nix flakes cli and the repl do no agree. #314
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#314
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?
Describe the bug
I have encountered some issues recently where the flake cli and the repl do not agree on what is a derivation. I have not found the reason for this yet,
Steps To Reproduce
one possibly way of reproducing is to
Expected behavior
nix build
should work here.nix --version
outputAdditional context
So, this is actually a flake thing. Almost everything except flakes that accepts a derivation will also accept a list or attrset of derivations (
nix-shell
andnix develop
are the notable exceptions).Flakes, however, are very strict and require that anything that expects a derivation to be exactly one derivation, and not anything else. In fact, not only can you not build an attrset or list of derivations, but it is considered a flake schema error to have any attribute in
outputs.packages.${system}
that is not a single derivation (this is whylegacyPackages
exists — it doesn't have that requirement, and allows arbitrary types and nested package sets, though as you'll see below this is only at the schema level, and flake-mode building still has the same requirement).For some examples:
So, basically, this is flakes having terrible UX by design, rather than a bug per se. But perhaps it is a flake design flaw we should fix in some way
…Actually wait, I couldn't reproduce this with that flake — has anything changed in it since you opened this issue?
i don't think I changed anything but I can't reproduce anymore, either, I think nix is gaslighting me again.
I must have changed something, let me dig
nope, cannot reproduce, even with commits far before opening this PR; I hope this doesn't have to do anything with local checkout vs git url.