cross-workarounds: review implementation
This makes it easier to compartmentalize workarounds specific to a
platform.
@@ -8,8 +8,27 @@ let
config.nixpkgs.crossSystem != null &&
config.nixpkgs.localSystem.system != null &&
config.nixpkgs.crossSystem.system != config.nixpkgs.localSystem.system;
+in
+lib.mkIf isCross (lib.mkMerge [
+
+# All cross-compilation
+{
+ # building '/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-fc-cache.drv'...
+ # [...]-fontconfig-2.10.2-aarch64-unknown-linux-gnu-bin/bin/fc-cache: cannot execute binary file: Exec format error
+ fonts.fontconfig.enable = false;
+
+ # building '/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-mesa-19.3.3-aarch64-unknown-linux-gnu.drv'...
+ # meson.build:1537:2: ERROR: Dependency "wayland-scanner" not found, tried pkgconfig
+ security.polkit.enable = false;
+
+ # udisks fails due to gobject-introspection being not cross-compilation friendly.
+ services.udisks2.enable = false;
+}
- AArch32Overlay = final: super:
+# 32 bit ARM
+(lib.mkIf config.nixpkgs.crossSystem.isAarch32 {
+ nixpkgs.overlays = [
+ (final: super:
# Ensure pkgsBuildBuild ends up unmodified, otherwise the canary test will
# get super expensive to build.
if super.stdenv.buildPlatform == super.stdenv.hostPlatform then {} else {
@@ -23,22 +42,8 @@ let
preInstall = ":";
})
;
- };
-in
-lib.mkIf isCross
-{
- # building '/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-fc-cache.drv'...
- # [...]-fontconfig-2.10.2-aarch64-unknown-linux-gnu-bin/bin/fc-cache: cannot execute binary file: Exec format error
- fonts.fontconfig.enable = false;
-
- # building '/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-mesa-19.3.3-aarch64-unknown-linux-gnu.drv'...
- # meson.build:1537:2: ERROR: Dependency "wayland-scanner" not found, tried pkgconfig
- security.polkit.enable = false;
-
- # udisks fails due to gobject-introspection being not cross-compilation friendly.
- services.udisks2.enable = false;
-
- nixpkgs.overlays = lib.mkMerge [
- (lib.mkIf config.nixpkgs.crossSystem.isAarch32 [ AArch32Overlay ])
+ })
];
-}
+})
+
+])
