-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathshell.nix
More file actions
55 lines (47 loc) · 1.18 KB
/
shell.nix
File metadata and controls
55 lines (47 loc) · 1.18 KB
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
53
54
55
{ 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 (hostPkgs.system == "x86_64-linux") then {
url = "https://ziglang.org/download/0.14.0/zig-linux-x86_64-0.14.0.tar.xz";
sha256 = "052pfb144qaqvf8vm7ic0p6j4q2krwwx1d6cy38jy2jzkb588gw3";
} else
throw ("Unknown system " ++ hostPkgs.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
hostPkgs.pkg-config
targetPkgs.libGL
targetPkgs.wayland
targetPkgs.libxkbcommon
];
LD_LIBRARY_PATH = "${targetPkgs.lib.makeLibraryPath buildInputs}";
}