diff options
author | Jared Baur <jaredbaur@fastmail.com> | 2024-02-29 19:22:33 -0800 |
---|---|---|
committer | Jared Baur <jaredbaur@fastmail.com> | 2024-03-01 09:05:08 -0800 |
commit | 3794246066409d7baac72e3fdfb0e4f66ef4a013 (patch) | |
tree | 384e1bd97c44dc4d23401b0b50f99db8064bcba0 /nixos/modules/misc/nixpkgs.nix | |
parent | 244ee5631a7a39b0c6bd989cdf9a1326cd3c5819 (diff) |
nixos/nixpkgs: fix determination for cross-compiled nixos system
Since the output of `lib.systems.elaborate` contains functions, an equality check with `==` does not suffice, `lib.systems.equals` should be used instead.
Diffstat (limited to 'nixos/modules/misc/nixpkgs.nix')
-rw-r--r-- | nixos/modules/misc/nixpkgs.nix | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nixos/modules/misc/nixpkgs.nix b/nixos/modules/misc/nixpkgs.nix index da321a9234493..10f800cd741a0 100644 --- a/nixos/modules/misc/nixpkgs.nix +++ b/nixos/modules/misc/nixpkgs.nix @@ -208,7 +208,11 @@ in example = { system = "x86_64-linux"; }; # Make sure that the final value has all fields for sake of other modules # referring to this. - apply = lib.systems.elaborate; + apply = inputBuildPlatform: + let elaborated = lib.systems.elaborate inputBuildPlatform; + in if lib.systems.equals elaborated cfg.hostPlatform + then cfg.hostPlatform # make identical, so that `==` equality works; see https://github.com/NixOS/nixpkgs/issues/278001 + else elaborated; defaultText = literalExpression ''config.nixpkgs.hostPlatform''; description = lib.mdDoc '' |