Skip to content

Commit e104dcf

Browse files
committed
nix: do not add android SDK on aarch64 Darwin
Otherwise it fails with: error: aarch64-darwin not supported for Android SDK. Use: NIXPKGS_SYSTEM_OVERRIDE=x86_64-darwin Signed-off-by: Jakub Sokołowski <[email protected]>
1 parent 2a216f3 commit e104dcf

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

flake.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,12 @@
6565
targets = [ name ];
6666
};
6767
}) targets));
68+
69+
devShells = forAllSystems (system: let
70+
pkgs = pkgsFor.${system};
71+
in {
72+
default = pkgs.callPackage ./nix/shell.nix { } ;
73+
});
6874
};
75+
6976
}

nix/default.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,3 @@ in stdenv.mkDerivation rec {
8888
platforms = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" "x86_64-windows"];
8989
};
9090
}
91-
92-

nix/shell.nix

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@
22
pkgs ? import <nixpkgs> { },
33
}:
44
let
5-
optionalDarwinDeps = pkgs.lib.optionals pkgs.stdenv.isDarwin [
6-
pkgs.libiconv
7-
pkgs.darwin.apple_sdk.frameworks.Security
8-
];
9-
in
10-
pkgs.mkShell {
11-
inputsFrom = [
5+
inherit (pkgs) lib stdenv;
6+
/* No Android SDK for Darwin aarch64. */
7+
isMacM1 = stdenv.isDarwin && stdenv.isAarch64;
8+
9+
in pkgs.mkShell {
10+
inputsFrom = lib.optionals isMacM1 [
1211
pkgs.androidShell
13-
] ++ optionalDarwinDeps;
12+
];
1413

1514
buildInputs = with pkgs; [
1615
which
1716
git
1817
cmake
1918
nim-unwrapped-2_2
19+
] ++ lib.optionals stdenv.isDarwin [
20+
pkgs.libiconv
21+
pkgs.darwin.apple_sdk.frameworks.Security
2022
];
2123

2224
# Avoid compiling Nim itself.

0 commit comments

Comments
 (0)