-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdefault.nix
More file actions
44 lines (40 loc) · 1.13 KB
/
default.nix
File metadata and controls
44 lines (40 loc) · 1.13 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
{localSystem ? builtins.currentSystem, ...} @ args: let
external_sources = import ./nix/sources.nix;
nixpkgs_import_args = {
inherit localSystem;
config = {};
};
nixpkgs = import external_sources.nixpkgs nixpkgs_import_args;
# To use bazelisk, not Bazel
devShell =
(nixpkgs.buildFHSEnv {
name = "bazel_toolchains_explained-shell";
targetPkgs = pkgs: (with pkgs; [
alejandra
bashInteractive
bazelisk
bazel-buildtools
cocogitto
git
helix
niv
statix
# Required by downloaded bazel
zlib
]);
runScript = nixpkgs.writeScript "bazel_toolchains_explained-shell-init.sh" ''
cat <<EOF > user.bazelrc
# Bazel from nix fails processing of repo-rules
# without this being set (sic!)
# TODO: Investigate further.
# (/bin:/usr/bin are for the benefit of the 'hermetic' gcc toolchain...)
common --action_env='PATH=/bin:/usr/bin:$PATH'
startup --output_user_root=$PWD/bazel-user-root/
EOF
exec bash
'';
})
.env;
in {
inherit devShell nixpkgs;
}