-
Notifications
You must be signed in to change notification settings - Fork 11
/
shell.nix
52 lines (51 loc) · 988 Bytes
/
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
with import ./build/nix/nixpkgs.nix {};
let
shellCommon = {
tools = [
bash
coreutils
findutils
go
nodejs
yarn
please
python3
bazel-buildtools
nix-prefetch
black
];
libs = [];
};
shellDarwin = {
tools = [
impure-cc
];
libs = [];
};
shellLinux = {
tools = [
impure-cc
];
libs = [];
};
in
mkShell {
nativeBuildInputs = [
(lib.optionals hostPlatform.isMacOS shellDarwin.tools)
(lib.optionals hostPlatform.isLinux shellLinux.tools)
shellCommon.tools
];
buildInputs = [
(lib.optionals hostPlatform.isMacOS shellDarwin.libs)
(lib.optionals hostPlatform.isLinux shellLinux.libs)
shellCommon.libs
];
hardeningDisable = ["fortify"];
shellHook = ''
export CGO_ENABLED="1"
export WORKSPACE="$(pwd)"
mkdir -p plz-out
touch plz-out/go.mod
rm -rf bazel-* .bazel-cache bin
'';
}