From a26bb74da1d5eb681c8f3f25fd0fa1c1a321d452 Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Wed, 3 Jul 2024 23:51:47 +0200 Subject: [PATCH] pkgs/overlays/unstable: pass crossSystem only when needed that is, only when buildPlatform and hostPlatform are not identical, fixes difference and build failure of stdenv, when using through overlay certain odd packages like `androidStudioPackages.canary` --- pkgs/overlays/unstable.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/overlays/unstable.nix b/pkgs/overlays/unstable.nix index 2a20c30..1cf4bae 100644 --- a/pkgs/overlays/unstable.nix +++ b/pkgs/overlays/unstable.nix @@ -28,7 +28,7 @@ let # localSystem -> pkgs.stdenv.buildPlatform localSystem = nixpkgs.stdenv.buildPlatform; # crossSystem -> pkgs.stdenv.hostPlatform or pkgs.stdenv.targetPlatform ?? - crossSystem = nixpkgs.stdenv.hostPlatform; + # passing below # config -> pkgs.config config = nixpkgs.config; # overlays -> partial of pkgs.overlays @@ -36,7 +36,11 @@ let # crossOverlays -> partial of pkgs.overlays # crossOverlays are merged to overlays, not sure what issues that might raise. # ignoring. - }; + } // (if nixpkgs.stdenv.buildPlatform == nixpkgs.stdenv.hostPlatform then {} else { + # workaround for some odd structured packages that changes behaviour + # when crossSystem is passed. + crossSystem = nixpkgs.stdenv.hostPlatform; + }); in { unstable = if useUnstable then unstablePkgsForNixpkgs self else self;