-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clarify definition of "installable" #7376
Conversation
b4de12d
to
1a5ed1f
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2022-12-02-nix-team-meeting-minutes-13/23731/1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that trying to mash together "anything accepted by any nix command is an installable and vice versa" is not only confusing but also incorrect. See below, a lot of nix commands which "take installables" reject some kinds of installables.
We shouldn't try to hide the difference between an outpath and its deriver from users.
This "everything is an installable and there is nothing but installables" papers over the many-to-one (Edit: many-to-many!) relationship between derivers and store objects. That will come back to bite us later, just like the "referring to a derivation always means referring to its realisation, except when it doesn't" problem that led to the --derivation
flag did.
@amjoseph-nixpkgs I think you're right, and all this hints at is that the CLI has some design issues. We should try to be as precise as possible, but I feel it's only worthwhile up to a point. Saying "it doesn't actually work for all the commands" has to suffice for now. Indeed we'd have to untangle the underlying issues first, which here is the overloading of argument types, but this is not the PR and, in my opinion, not yet the time to do so. I'll fix up what seems reasonable and would then try to get closer to merging. |
3d4d070
to
f243da2
Compare
f243da2
to
25a1023
Compare
@amjoseph-nixpkgs updated according to your suggestions. @Nixos/nix-team ready for review. |
25a1023
to
6937e3b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your identification of the installables which "can be evaluated, that is, a flake or Nix expression, but not a store path or store derivation path" is a very important clarification -- so much so that I think it deserves a name (I used evaluatable below, but if you have another one you like better go ahead and change it).
With definitions for the terms installable and evaluatable we can give accurate and very succinct specifications for the arguments of every command except nix show-derivation
. I think that's a sign that we've got the right taxonomy.
I think if you add a definition for evaluatable the result is pretty coherent.
cd3b6a2
to
a6b08f3
Compare
So it turns out that In other words, "operations on derivations operate on their realisation except when |
@amjoseph-nixpkgs the one difference for |
I don't think so; I don't have them in my I think the problem is actually in the ProseIf your local store has neither particular outpath (say,
will copy the outpath, but not its deriver, to your local machine. If you instead run
then both the outpath and the deriver will be copied to your local machine. This contradicts the rule "using a derivation as an installable produces exactly the same result as using its realisation as an installable". Bash
|
@amjoseph-nixpkgs I also encountered this inconsistency and think it's a valid point we should address with a design decision. Please open an issue. @thufschmitt While it's still not perfect, I think it's ready to merge. Could you please take look? |
@amjoseph-nixpkgs is this just the old CLI? Or also |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking very nice!
this is easier to edit, provides anchors for free, and renders correctly on the terminal without additional effort.
the term was hard to discover, as its definition and explanation were in a very long document lacking an overview section. search did not help because it occurs so often. - clarify wording in the definition - add an overview of installable types - add "installable" to glossary - link to definition from occurrences of the term - be more precise about where store derivation outputs are processed - installable Nix expressions must evaluate to a derivation Co-authored-by: Adam Joseph <[email protected]>
f488bbf
to
2af9fd2
Compare
@thufschmitt please take a look. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/this-month-in-nix-docs-1-march-2023/26913/1 |
the term was hard to discover, as its definition and explanation were in
a very long document lacking an overview section.
search did not help because it occurs so often.
the first commit makes descriptions of each installable type its own subsection.
it makes for a messy diff but does not change contents. read the second commit to see the actual changes.
This work is sponsored by Antithesis ✨