Skip to content

nixpkgs module: Fix defaulting of localSystem and system for 18.09#46343

Merged
grahamc merged 1 commit intoNixOS:release-18.09from
obsidiansystems:fix-46320
Sep 8, 2018
Merged

nixpkgs module: Fix defaulting of localSystem and system for 18.09#46343
grahamc merged 1 commit intoNixOS:release-18.09from
obsidiansystems:fix-46320

Conversation

@Ericson2314
Copy link
Member

Backport of #46341

Take two of NixOS#40708 (4fe2898).

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 NixOS#46320
@Ericson2314 Ericson2314 requested a review from nbp as a code owner September 7, 2018 21:05
@Ericson2314 Ericson2314 changed the title nixpkgs module: Fix defaulting of localSystem and system nixpkgs module: Fix defaulting of localSystem and system for 18.09 Sep 7, 2018
@GrahamcOfBorg GrahamcOfBorg added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 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. labels Sep 7, 2018
@grahamc grahamc merged commit 07cfc2f into NixOS:release-18.09 Sep 8, 2018
@Ericson2314 Ericson2314 deleted the fix-46320 branch September 8, 2018 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants