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
all-packages.nix: move defaults to package files #55129
all-packages.nix: move defaults to package files #55129
Conversation
These are already inherited in the parent derivation.
@@ -1,4 +1,4 @@ | |||
{stdenvNoCC, subversion, sshSupport ? false, openssh ? null, expect}: | |||
{stdenvNoCC, subversion, sshSupport ? true, openssh ? null, expect}: |
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.
Shoud this openssh ? null
become just openssh
if the local default for ssh support is true
?
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.
In theory: no preference, in practice: it usually it is not in most other expressions.
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.
The default will have the openssh
argument, so getting null
already needs an explicit override, no?
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.
Strictly speaking, the default it will get depends on callPackage
implementation used, so the above should be okay, normally. In this instance, however, the output will depend on openssh
anyway because the path gets burned into derivation irrespective of sshSupport
. I'm not sure if fixing this should be in scope of this PR, though.
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 was only asking about default argument values, I agree with both your implied claims (ignoring the argument if the support if off is good, but fixing this is out of scope).
I think if it is called in Nixpkgs exactly once, it is acceptable to assume this is the only type of callPackage
that will be applied.
, x11Support ? false, xlibsWrapper ? null | ||
, cupsSupport ? false, cups ? null | ||
, cupsSupport ? config.ghostscript.cups or (!stdenv.isDarwin), cups ? null | ||
, x11Support ? cupsSupport, xlibsWrapper ? null # with CUPS, X11 only adds very little |
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.
Somewhat borderline on that… (I do not oppose that, but do not actively suport and will wait longer for objections to this change before merging)
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.
But that is exactly what was written in all-packages.nix
before this change.
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 with the logic, I am just not sure if this type of extracting defaults from contents of other arguments is something everyone has made peace with.
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.
Hm, I felt this was a common thing to do, grep -rE '.*Support \? .*Support'
gives a lot of results.
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 tried to comment on the entire two-line combo — …Support ? …Support
but together with …Support ? config.…
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.
Ah, I see. Well, a) it is just another variable binding, so not that much of a difference, IMHO b) I don't see any other options in this case as applying config.ghostscript or {}
in all-packages.nix
will do the wrong thing.
licenseFile = config.gams.licenseFile or null; | ||
optgamsFile = config.gams.optgamsFile or null; | ||
}; | ||
gams = callPackage ../tools/misc/gams (config.gams or {}); |
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.
temporary dependency version overrides (in our normal «update/pin old where needed/investigate» upproach) would become a bit more annoying with this style in all-packages.nix
…
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.
Sure, but I did not invent this style, this is the style that is already used in all-packages.nix
.
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.
… unfortunately. Although it seems that this abbreviation indeed doesn't lead to the expected problem in practice.
ping? |
Indeed. |
Thanks! |
What?
A bit of noop cleanups followed by a first patchset in a series that moves package option defaults (like
whateverSupport = false
) fromall-packages.nix
to the package expressions themselves.I take specific care not to rename or drop any
config
options here (I do add some as a side-effect, though).Why?
Because definitions in
all-packages.nix
and package expression frequently conflict. It also makes #50643 (which itself is motivated by a proper implementation of #12877) much easier to do.git log
dwm: cleanup whitespace
dysnomia: cleanup whitespace
pulseaudioFull, libpulseaudio-vanilla: cleanup
These are already inherited in the parent derivation.
top-level: fix a typo
top-level: cleanup whitespace
lib: tiny cleanup
*: move defaults to the package file
A bunch of these.
nix-instantiate
environmentnix-env -qaP
diffs/cc @matthewbauer @7c6f434c, I guess