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
Add top-level/overrides.nix for package overrides #39515
Conversation
Semi-automatic update. These checks were performed: - built on NixOS - found 0.7.5 with grep in /nix/store/7y3a77lh1w5ghqlmy5l00bsx90dpwyy4-thin-provisioning-tools-0.7.5 - found 0.7.5 in filename of file in /nix/store/7y3a77lh1w5ghqlmy5l00bsx90dpwyy4-thin-provisioning-tools-0.7.5 cc "@globin"
Semi-automatic update generated by https://github.com/ryantm/nixpkgs-update tools. This update was made based on information from https://repology.org/metapackage/xpra/versions. These checks were done: - built on NixOS - ran ‘/nix/store/yh7iwzli0pcqnhm2vdcc2ha5ifig1ix0-xpra-2.2.6/bin/xpra -h’ got 0 exit code - ran ‘/nix/store/yh7iwzli0pcqnhm2vdcc2ha5ifig1ix0-xpra-2.2.6/bin/xpra --help’ got 0 exit code - ran ‘/nix/store/yh7iwzli0pcqnhm2vdcc2ha5ifig1ix0-xpra-2.2.6/bin/udev_product_version -h’ got 0 exit code - ran ‘/nix/store/yh7iwzli0pcqnhm2vdcc2ha5ifig1ix0-xpra-2.2.6/bin/udev_product_version --help’ got 0 exit code - ran ‘/nix/store/yh7iwzli0pcqnhm2vdcc2ha5ifig1ix0-xpra-2.2.6/bin/udev_product_version help’ got 0 exit code - ran ‘/nix/store/yh7iwzli0pcqnhm2vdcc2ha5ifig1ix0-xpra-2.2.6/bin/.xpra_launcher-wrapped -h’ got 0 exit code - ran ‘/nix/store/yh7iwzli0pcqnhm2vdcc2ha5ifig1ix0-xpra-2.2.6/bin/.xpra_launcher-wrapped --help’ got 0 exit code - ran ‘/nix/store/yh7iwzli0pcqnhm2vdcc2ha5ifig1ix0-xpra-2.2.6/bin/xpra_launcher -h’ got 0 exit code - ran ‘/nix/store/yh7iwzli0pcqnhm2vdcc2ha5ifig1ix0-xpra-2.2.6/bin/xpra_launcher --help’ got 0 exit code - ran ‘/nix/store/yh7iwzli0pcqnhm2vdcc2ha5ifig1ix0-xpra-2.2.6/bin/..xpra-wrapped-wrapped -h’ got 0 exit code - ran ‘/nix/store/yh7iwzli0pcqnhm2vdcc2ha5ifig1ix0-xpra-2.2.6/bin/..xpra-wrapped-wrapped --help’ got 0 exit code - ran ‘/nix/store/yh7iwzli0pcqnhm2vdcc2ha5ifig1ix0-xpra-2.2.6/bin/.xpra-wrapped -h’ got 0 exit code - ran ‘/nix/store/yh7iwzli0pcqnhm2vdcc2ha5ifig1ix0-xpra-2.2.6/bin/.xpra-wrapped --help’ got 0 exit code - found 2.2.6 with grep in /nix/store/yh7iwzli0pcqnhm2vdcc2ha5ifig1ix0-xpra-2.2.6 - directory tree listing: https://gist.github.com/01ffc3c415200e59fd7469357044a87a
Officially both python2 and 3 are supported.
Additionally, some settings based on NixOS configuation is set via defaultConfig which is then merged with the user provided configration. For now that just means http port and time zone but others can easily be added.
HA doesn't mind the configuration being JSON instead of YAML but since YAML is the official language, use that as it allows users to easily exchange config data with other parties in the community.
as there are none
So I think this is a good example of premature optimization. Unless your project will break with a larger version of imagemagick, it should just refer to If you want your docker container to avoid the "big" version of imagemagick because of space constraints, etc., you should do that in an override. This will only work correctly if you're sure that nothing in your closure needs the larger version of imagemagick (otherwise you'll get double like the above). I'm also in favor of having a flag to "imagemagick" that is something like "light" if the code duplication mentioned is too much. My main objection is putting "light" in the attribute name. So I definitely think this PR is the right way to go - but I understand that people feel uncomfortable with it. Importantly, though, this won't break overrides right now but just try to contain some of the ugliness in one place. A key insight to all of this is each top-level attribute in |
@@ -126,7 +127,8 @@ let | |||
trivialBuilders | |||
splice | |||
allPackages | |||
aliases | |||
(if (config.quickEval or false) then (self: super: {}) else defaultOverrides) |
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.
@nbp Does this flag make sense to you? My main goal is to get rid of overrides and aliases in Nixpkgs. Making their overlays optional seems like a straightforward way to do that (of course it will break eval currently, but give us a way to find where their used).
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.
You are interested in drawing the graph of dependencies between various attributes, in order to remove the unused one?
I think this might make sense for the "soon to be removed", in which case this could give a grace period for people to move these to their own overlays. Maybe config.enableObsoleteOverrides
would be more explicit.
Otherwise to detect which one can be moved to this list, I suggest to make an overlay which does something like:
self: super:
super.lib.mapAttrs (n: v: __trace n) super
Then evaluate the whole list of packages you are interested in, and pipe the error output into sort -Ru
which should give you the list of top-level packages / overrrides which are used directly or indirectly.
If I were to not care about the closure size, why would I be thinking about using overrides at all? First I would just write
But that problem becomes even more likely to happen when overrides are used instead of using things like
Why so? Even without this Also as mentioned, in the current state of Nixpkgs, the existence of things like |
It's more likely at least when the default imagemagick doesn't have ffmpegSupport or ghostscriptSupport. But with package overrides we can change the default to optimize our closure:
Our new imagemagick will be identical to
So-
Yes, discoverability is definitely an issue with flags. I wouldn't necessarily say that the status quo is very discoverable either though (for the longest time, I thought emacs25-nox was somehow related to @madjar's nox). One thing that's important to realize though is that we can use things from the binary cache without referring to them directly. Nix's hashing means that it can't tell the difference between:
and
and substitution will occur in both. Part of what is missing from all of this is a good way for Hydra to put overlays into the binary cache. I am looking into doing something like this in #39580 & I think something like a default "headless" overlay in the binary cache could be really useful. For now, though, this PR keeps our overrides in the binary cache (and we can certainly add more). |
This is some work cleaning up all-packages.nix. The big and maybe controversial change is adding
pkgs/top-level/overrides.nix
. This file works similarly topkgs/top-level/aliases.nix
does. The main difference is that it holds "overrides" that used to be in Nixpkgs. These were put in as convenience for users like aliases. Hopefully will make it easier for someone to implement #12877.We get rid of >800 lines in all-packages so hopefully this is well received. I'll wait a little bit for feedback but remember that these kind of changes will get outdated fairly quickly (I can always rebase though). This shouldn't change any hashes hopefully.
/cc @oxij