nixpkgs/nixos/lib
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
..
test-driver nixos/tests: Fix QEMU flags for SCSI disks 2018-04-30 03:02:59 +02:00
testing jquery & jquery-ui: Move to nixos/lib/testing/ 2018-02-27 20:07:35 +08:00
build-vms.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
eval-config.nix nixpkgs module: Fix defaulting of localSystem and system 2018-09-07 16:43:56 -04:00
from-env.nix
make-channel.nix Unify NixOS and Nixpkgs channel structure 2015-08-05 17:37:11 +02:00
make-disk-image.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
make-ext4-fs.nix make-ext4-fs: Fix cross compiling 2018-08-21 14:05:23 +03:00
make-iso9660-image.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
make-iso9660-image.sh ISO images: Initialize the Nix database with correct NAR hashes/sizes 2018-02-07 16:54:23 +01:00
make-squashfs.nix ISO images: Initialize the Nix database with correct NAR hashes/sizes 2018-02-07 16:54:23 +01:00
make-system-tarball.nix reewide: Purge all uses stdenv.system and top-level system 2018-08-30 17:20:32 -04:00
make-system-tarball.sh make-system-tarball: allow alternate compression methods 2018-04-03 11:30:43 -03:00
qemu-flags.nix reewide: Purge all uses stdenv.system and top-level system 2018-08-30 17:20:32 -04:00
testing.nix [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
utils.nix nixos: generalize copy-paste from stage-1 and zfs to utils 2016-08-23 18:14:06 +00:00