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

nixos: introduce nixpkgs.pkgsFun, deprecate nixpkgs.pkgs #57067

Closed
wants to merge 1 commit into from

Conversation

oxij
Copy link
Member

@oxij oxij commented Mar 8, 2019

git log

  • nixos: introduce nixpkgs.pkgsFun, deprecate nixpkgs.pkgs

    Despite what the description of nixpkgs.pkgs option said, the
    use of nixpkgs.pkgs actually produced 2x evaluation slowdown
    after a54a799 because NixOS had
    to reevaluate nixpkgs to reapply overlays the second time.

    The use of nixpkgs.pkgs also complicates many things, e.g. why
    are overlays reapplied, but configuration is not? It also
    prevents proper config type checking via Typed nixpkgs.config with Gentoo-like use-flags #56227.

    nixpkgs.pkgsFun approach is much simpler and doesn't have
    any of those problems, half of the code in that module can also be
    dropped after nixpkgs.pkgs option is completely removed.

    If such an option is really needed for optimizion purposes of
    nixosTests or whatever (which I doubt, note that e.g.
    NixOps users actually lose on average by using it for above
    reasons), it should be made internal and hidden from users.

nix-instantiate environment

  • Host OS: Linux 4.9, SLNOS 19.09
  • Nix: nix-env (Nix) 2.2
  • Multi-user: yes
  • Sandbox: yes
  • NIXPKGS_CONFIG:
{
  checkMeta = true;
  doCheckByDefault = true;
}

nix-env -qaP diffs

  • On x86_64-linux:
    • Updated (2):
      • tests.nixos-functions.nixos-test
      • tests.nixos-functions.nixosTest-test
  • On aarch64-linux: ditto
  • On x86_64-darwin: noop

/cc @roberth @Ericson2314 @matthewbauer from git-blame, @7c6f434c

Despite what the description of `nixpkgs.pkgs` option said, the
use of `nixpkgs.pkgs` actually produced 2x evaluation slowdown
after a54a799 because NixOS had
to reevaluate `nixpkgs` to reapply overlays the second time.

The use of `nixpkgs.pkgs` also complicates many things, e.g. why
are `overlays` reapplied, but `configuration` is not? It also
prevents proper `config` type checking via NixOS#56227.

`nixpkgs.pkgsFun` approach is much simpler and doesn't have
any of those problems, half of the code in that module can also be
dropped after `nixpkgs.pkgs` option is completely removed.

If such an option is really needed for optimizion purposes of
`nixosTests` or whatever (which I doubt, note that e.g.
NixOps users actually lose on average by using it for above
reasons), it should be made `internal` and hidden from users.
@oxij oxij requested a review from infinisil as a code owner March 8, 2019 08:47
@oxij
Copy link
Member Author

oxij commented Mar 8, 2019

I would also backport this everywhere.

@oxij
Copy link
Member Author

oxij commented Mar 8, 2019

Hm, actually, I got a better idea. Will update and reopen this tomorrow.

@oxij oxij closed this Mar 8, 2019
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

2 participants