Skip to content

pkgs.nixos: Expose configuration directly - #62046

Merged
lheckemann merged 1 commit into
NixOS:masterfrom
roberth:pkgs-nixos-expose-all-config
Sep 1, 2019
Merged

lheckemann merged 1 commit into
NixOS:masterfrom
roberth:pkgs-nixos-expose-all-config

Conversation

@roberth

@roberth roberth commented May 25, 2019 •

Copy link
Copy Markdown
Member

The pkgs.nixos used to only expose system.build, which kind of made
sense in theory, but asking everyone to write modules when to want
to pull something out of a NixOS configuration is just not realistic.
In fact it's very inconvenient when you're trying to debug something.

This adds the config, options and anything that eval-config.nix
produces. Although this introduces the potential for attributes
of eval-config.nix output to shadow system.build, I don't expect
naming collisions to be commonplace, or to remain undetected during
evaluation. Also such an error should be easy to resolve, by explicitly
querying (pkgs.nixos {}).config.system.build.X, or by renaming X
to something other than config, options, extraArgs, pkgs.

Motivation for this change
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 nix-review --run "nix-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.

The pkgs.nixos used to only expose system.build, which kind of made
sense in theory, but asking everyone to write modules when to want
to pull something out of a NixOS configuration is just not realistic.
In fact it's very inconvenient when you're trying to debug something.

This adds the config, options and anything that eval-config.nix
produces. Although this introduces the potential for attributes
of eval-config.nix output to shadow system.build, I don't expect
naming collisions to be commonplace, or to remain undetected during
evaluation. Also such an error should be easy to resolve, by explicitly
querying (pkgs.nixos {}).config.system.build.X, or by renaming X
to something other than config, options, extraArgs.
@roberth roberth added 0.kind: enhancement Add something new or improve an existing system. 8.has: documentation This PR adds or changes documentation 6.topic: user experience NixOS / Nixpkgs end user experience 11.by: nixpkgs-member 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. labels May 25, 2019
@ofborg ofborg Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. and removed 8.has: documentation This PR adds or changes documentation labels May 25, 2019
@roberth roberth mentioned this pull request May 26, 2019
10 of 14 tasks
@aanderse

aanderse commented Sep 1, 2019

Copy link
Copy Markdown
Member

@lheckemann is a merge in order?

@lheckemann
lheckemann merged commit d9db65c into NixOS:master Sep 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.kind: enhancement Add something new or improve an existing system. 6.topic: user experience NixOS / Nixpkgs end user experience 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants