diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix index e921f7decf1a..bfc2ee8f664c 100644 --- a/pkgs/top-level/stage.nix +++ b/pkgs/top-level/stage.nix @@ -280,28 +280,6 @@ let else throw "i686 Linux package set can only be used with the x86 family."; - # x86_64-darwin packages for aarch64-darwin users to use with Rosetta for incompatible packages - pkgsx86_64Darwin = - if stdenv.hostPlatform.isDarwin then - nixpkgsFun { - overlays = [ - (self': super': { - pkgsx86_64Darwin = super'; - }) - ] - ++ overlays; - localSystem = { - config = lib.systems.parse.tripleFromSystem ( - stdenv.hostPlatform.parsed - // { - cpu = lib.systems.parse.cpuTypes.x86_64; - } - ); - }; - } - else - throw "x86_64 Darwin package set can only be used on Darwin systems."; - # If already linux: the same package set unaltered # Otherwise, return a natively built linux package set for the current cpu architecture string. # (ABI and other details will be set to the default for the cpu/os pair) diff --git a/pkgs/top-level/variants.nix b/pkgs/top-level/variants.nix index bb4b877cb6e8..fb4890910cdf 100644 --- a/pkgs/top-level/variants.nix +++ b/pkgs/top-level/variants.nix @@ -90,6 +90,28 @@ self: super: { else throw "Musl libc only supports 64-bit Linux systems."; + # x86_64-darwin packages for aarch64-darwin users to use with Rosetta for incompatible packages + pkgsx86_64Darwin = + if stdenv.hostPlatform.isDarwin then + nixpkgsFun { + overlays = [ + (self': super': { + pkgsx86_64Darwin = super'; + }) + ] + ++ overlays; + localSystem = { + config = lib.systems.parse.tripleFromSystem ( + stdenv.hostPlatform.parsed + // { + cpu = lib.systems.parse.cpuTypes.x86_64; + } + ); + }; + } + else + throw "x86_64 Darwin package set can only be used on Darwin systems."; + # Full package set with rocm on cuda off # Mostly useful for asserting pkgs.pkgsRocm.torchWithRocm == pkgs.torchWithRocm and similar pkgsRocm = nixpkgsFun ({