From 9d8d66baf56210604cb78c2bc717e717be386812 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sat, 21 Mar 2020 23:23:24 -0400 Subject: 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 --- nixos/modules/misc/nixpkgs.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nixos/modules/misc/nixpkgs.nix') diff --git a/nixos/modules/misc/nixpkgs.nix b/nixos/modules/misc/nixpkgs.nix index 011d493c153..4f5a9250eaa 100644 --- a/nixos/modules/misc/nixpkgs.nix +++ b/nixos/modules/misc/nixpkgs.nix @@ -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" -- cgit 1.4.1