From 6b81859ed0e35f052043384c7febb853176bc500 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 3 Feb 2025 19:33:20 +0000 Subject: [PATCH] nixpkgs: fix determination for cross-compiled nix-darwin system Since the output of `lib.systems.elaborate` contains functions, an equality check with `==` does not suffice, `lib.systems.equals` should be used instead. Backport of Nixpkgs commit 3794246066409d7baac72e3fdfb0e4f66ef4a013. Co-authored-by: Jared Baur --- modules/nix/nixpkgs.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/nix/nixpkgs.nix b/modules/nix/nixpkgs.nix index 6c54c82..383b140 100644 --- a/modules/nix/nixpkgs.nix +++ b/modules/nix/nixpkgs.nix @@ -181,7 +181,12 @@ in example = { system = "x86_64-darwin"; }; # 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 = ''