1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-20 04:31:52 +00:00
nixpkgs/nixos/modules/misc
John Ericson 9f9723b179 nixpkgs module: Fix defaulting of localSystem and system
Take two of #40708 (4fe2898608).

That PR attempted to bidirectionally default `config.nixpkgs.system` and
`config.nixpkgs.localSystem.system` to each be updated by the other. But
this is not possible with the way the module system works. Divergence in
certain cases in inevitable.

This PR is more conservative and just has `system` default `localSystem`
and `localSystem` make the final call as-is. This solves a number of
issues.

 - `localSystem` completely overrides `system`, just like with nixpkgs
 proper. There is no need to specify `localSystem.system` to clobber the
 old system.

 - `config.nixpkgs.localSystem` is exactly what is passed to nixpkgs. No
 spooky steps.

 - `config.nixpkgs.localSystem` is elaborated just as nixpkgs would so
 that all attributes are available, not just the ones the user
 specified.

The remaining issue is just that `config.nixpkgs.system` doesn't update
based on `config.nixpkgs.localSystem.system`. It should never be
referred to lest it is a bogus stale value because
`config.nixpkgs.localSystem` overwrites it.

Fixes #46320
2018-09-07 16:43:56 -04:00
..
assertions.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
crashdump.nix nixos/crashdump: fix evaluation. (#30415) 2017-10-25 20:00:52 +00:00
documentation.nix system-path: allow other modules to provide setup fragments 2018-08-16 21:23:34 +01:00
extra-arguments.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
ids.nix nixos/zeronet: init (#44842) 2018-08-31 11:40:23 +01:00
label.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
lib.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
locate.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
meta.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
nixpkgs.nix nixpkgs module: Fix defaulting of localSystem and system 2018-09-07 16:43:56 -04:00
passthru.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
version.nix nixos/modules/misc/version.nix: Don't spam the user with vague warnings 2018-08-10 21:39:36 +02:00