From 69d7939a6221bf86498488d1f641560b7d5d0a8a Mon Sep 17 00:00:00 2001 From: Atemu Date: Thu, 24 Feb 2022 12:17:46 +0100 Subject: pkgsx86Darwin: init Many packages don't work on aarch64-darwin yet or are x86-only binary packages. This gives aarch64-darwin users easy access to x86_64-darwin packages to run via Rosetta 2. "x86" was used as a short-hand instead of x86_64 because x86_64-darwin is the only x86 Darwin package set. --- pkgs/top-level/stage.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'pkgs/top-level/stage.nix') diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix index 9d34ddb3685..96ee8cd1265 100644 --- a/pkgs/top-level/stage.nix +++ b/pkgs/top-level/stage.nix @@ -213,6 +213,18 @@ 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 + pkgsx86Darwin = if stdenv.hostPlatform.isDarwin then nixpkgsFun { + overlays = [ (self': super': { + pkgsx86Darwin = super'; + })] ++ overlays; + localSystem = { + parsed = stdenv.hostPlatform.parsed // { + cpu = lib.systems.parse.cpuTypes.x86_64; + }; + }; + } else throw "x86 Darwin package set can only be used on Darwin systems."; + # Extend the package set with zero or more overlays. This preserves # preexisting overlays. Prefer to initialize with the right overlays # in one go when calling Nixpkgs, for performance and simplicity. -- cgit 1.4.1