Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[RFC 0140] Simple Package Paths #140
[RFC 0140] Simple Package Paths #140
Changes from 3 commits
3ca531a
269ac4f
21c3493
e203231
967beb1
b077e2f
1d7e66a
0054e7a
ffad8ea
66f0225
89ea8e7
4426f20
4f0c06f
98f8287
e6bd2f5
632fb4d
71e40dc
46c23ae
f7c3056
f53a862
e5b2019
b72d482
7a03d43
13c4f39
f15c1cf
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
@piegamesde See here, that's exactly what's done.
pkg-fun.nix
(or newly package.nix) is just the olddefault.nix
(we could also call itdefault.nix
, see alternatives section). And note how the second argument is{}
, meaning the auto-calling only works for packages that don't require any arguments. However see theCustom arguments
section, which allows you to also call the unit directories fromall-packages.nix
if you need to pass a non-{}
argument.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 would like to nominate
auto
, to me this is more future-proof thanunit
so we can include multiple packages in one directoryThere 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.
How do you mean that?
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.
For example, we currently have
element-desktop
andelement-web
that share the samepin.json
(orgeneric.nix
in some other cases), in the future we might want to allow that to be defined inpkgs/unit
, but I'm not quite sure the nameunit
fits the behavior of having multiple packages under the same directory, andauto
is more future-proof in that case IMOThere 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 see, yeah so this has been discussed before. I believe in the team the consensus was that multiple versions and variants should eventually end up in the same
pkgs.element
attribute, once we have the design for that figured out. In that case, all those variants would naturally be together in thepkgs/unit/el/element
directory.That's also kind of why
unit
was chosen, we talked about explaining it better before, something like: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.
that makes sense to me, thanks for the explanation
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.
Naming is really important, especially for something as ubiquitous. Please add the rationale for choosing "unit" over the other proposals, just as you did for all the other decisions. Otherwise it will produce guesswork, confusion, and needless resistance in readers.
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 don't dislike "auto" but I'd like to note that the name implies the package is automatically called. This means that packages with custom arguments would not fit in there anymore, unlike with the current proposal. Maybe they'd be put into "pkgs/manual" instead then? (which then opens up to confusion with manual as in documentation, etc.)
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.
None of the solutions discussed so far present an elegant solution, and I don't think one exists. Module solution sounds like it would be quite fitting here (although out of scope of the RFC), so leaving this here for reference:
https://www.youtube.com/watch?v=dTd499Y31ig
I think that would solve the
jami-daemon = jami.jami-daemon
problem by itself, and very possiblywlroots = wlroots_0_14
ifversion
will become an option that has meaning.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.
Yes, I that's probably out of scope for this PR, but there's relatively fresh working group about exactly this topic. We have a matrix room, weekly meetings on Friday and a Repo to manage things, see https://github.com/nixpkgs-architecture/pkgs-modules
EDIT: maybe we could reference the WG here?
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.
How about another standardized autocalled file
aliases.nix
that contains aliases for packages and calls with custom arguments?This way, everything belonging to a package would still be in the unit directory.
The
aliases.nix
will not be allowed to create an attribute with the same name as the containing folder:For example:
.../ne/nerdfonts/aliases.nix
could look something like this:To keep the scope small, that would be an idea for another follow-up RFC.
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 agree.
I believe such an idea has been considered, but was rejected for scope reasons, and a potential performance issue.
As these files would each be able to affect the top level
attrNames
, they would all have to be parsed before constructing "pkgs". So far we've kept the proposal from having to scan the contents of all unit directories when evaluating a limited set of attribute values. Actually parsing files in many of them would change that. Most practical usages do not involve evaluating all of Nixpkgs, so we should optimize to keep "individual" package evaluations fast.The actual performance impact has not been measured though, nor have we assessed the changes on the human side.
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.
There's an answer missing here ;) I believe it might be good enough to keep them in
all-packages.nix
, just as with custom args, for now, in order to keep the scope small?