nixos/nixpkgs.nix: Allow just using config in system (#80818)

* nixos/nixpkgs.nix: Allow just using config in system

This assertion requires system to work properly. We might not have
this in cases where the user just sets config and wants Nixpkgs to
infer system from that. This adds a default for when this happens,
using doubleFromSystem.

* parens
This commit is contained in:
Matthew Bauer 2020-03-21 23:23:24 -04:00 committed by GitHub
parent 6b95893a6d
commit 9d8d66baf5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -236,8 +236,8 @@ in
let
nixosExpectedSystem =
if config.nixpkgs.crossSystem != null
then config.nixpkgs.crossSystem.system
else config.nixpkgs.localSystem.system;
then config.nixpkgs.crossSystem.system or (lib.systems.parse.doubleFromSystem (lib.systems.parse.mkSystemFromString config.nixpkgs.crossSystem.config))
else config.nixpkgs.localSystem.system or (lib.systems.parse.doubleFromSystem (lib.systems.parse.mkSystemFromString config.nixpkgs.localSystem.config));
nixosOption =
if config.nixpkgs.crossSystem != null
then "nixpkgs.crossSystem"