Skip to content
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

[WIP] all-packages.nix: Use pkgs ("self") instead of res (next stage super) #51527

Closed
wants to merge 1 commit into from

Conversation

roberth
Copy link
Member

@roberth roberth commented Dec 4, 2018

Motivation for this change

res is redundant. The goal of this PR is to run it on ofborg so changes can be triaged.

@Ericson2314 have a look :)

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@danbst
Copy link
Contributor

danbst commented Jan 23, 2019

pkgs. is redundant as well

@roberth
Copy link
Member Author

roberth commented Jan 24, 2019

@danbst you can arrange it such that it is, but I don't know whether that's an improvement. It may make conforming with nbp's security idea easier, but otherwise it just obfuscates the still existing possibility of depending on arbitrary parts of the final package set.

@roberth
Copy link
Member Author

roberth commented Jan 24, 2019

@Ericson2314 did you make any progress on the drv differences from these changes?

@infinisil
Copy link
Member

@roberth Not sure what you mean. There's a with pkgs; at the very top of all-packages.nix so everything is in scope already and you don't need to use pkgs.. It's what is being done in the rest of that file as well.

@danbst
Copy link
Contributor

danbst commented Jan 24, 2019

@roberth the nbp's security proposal forbids this:

pkgs: super:
rec {
  ...
}

but it is not a case for all-packages.nix now (like @infinisil mentioned). It is:

pkgs: super:
with pkgs; {
  ...
}

And this is fine

@roberth
Copy link
Member Author

roberth commented Jan 24, 2019

@danbst, I read that as deleting the whole pkgs parameter, perhaps relying on callPackage.

I prefer to avoid the with keyword with the repl as the only exception, because it makes finding a declaration harder and it makes static scope checking impossible.

My original goal was to solve the previous inconsistent naming as done in #51401.
I don't feel very strongly about this pr, so feel free to improve it as you please.

danbst added a commit to danbst/nixpkgs that referenced this pull request Feb 1, 2019
@danbst
Copy link
Contributor

danbst commented Feb 1, 2019

closing in favor of #55061

@danbst danbst closed this Feb 1, 2019
@roberth roberth deleted the all-packages-res-to-pkgs branch February 2, 2019 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants