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.
This commit is contained in:
Atemu 2022-02-24 12:17:46 +01:00
parent 48d63e924a
commit 69d7939a62

View File

@ -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.