-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathshell.nix
52 lines (44 loc) · 1.14 KB
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{ cross ? false }:
let
hostPkgs = import <nixpkgs> {};
armPkgs = import <nixpkgs> {
system = "aarch64-linux";
};
crossPkgs = import <nixpkgs> {
overlays = [(self: super: {
inherit (armPkgs)
gcc
mesa
libGL
;
})];
crossSystem = hostPkgs.lib.systems.examples.aarch64-multiplatform;
};
targetPkgs = if cross then crossPkgs else hostPkgs;
zig = hostPkgs.stdenv.mkDerivation {
name = "zig";
src = fetchTarball (
if (targetPkgs.system == "x86_64-linux") then {
url = "https://ziglang.org/download/0.11.0/zig-linux-x86_64-0.11.0.tar.xz";
sha256 = "0385m6sfaxcfy91l4iwi3zkr705zbn4basvkkkbba7yh635aqr78";
} else
throw ("Unknown system " ++ targetPkgs.system)
);
dontConfigure = true;
dontBuild = true;
installPhase = ''
mkdir -p $out
mv ./* $out/
mkdir -p $out/bin
mv $out/zig $out/bin
'';
};
in
hostPkgs.mkShell rec {
buildInputs = [
zig
hostPkgs.git
targetPkgs.libGL.all
targetPkgs.xorg.libX11.dev
];
}