-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
33 lines (33 loc) · 1.36 KB
/
flake.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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
# Library for working with tools that need default.nix and shell.nix.
# https://nixos.wiki/wiki/Flakes#Using_flakes_with_stable_Nix
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { nixpkgs, flake-utils, ... }:
# For every platform that Nix supports, we ...
flake-utils.lib.eachDefaultSystem (system:
# ... get the package set for this particular platform ...
let pkgs = import nixpkgs { inherit system; };
in {
# ... and define a development shell for it ...
devShells.default = with pkgs; mkShell {
# BEGIN Config to build Bazel 6
# do not use Xcode on macOS
BAZEL_USE_CPP_ONLY_TOOLCHAIN = "1";
# for nixpkgs cc wrappers, select C++ explicitly (see https://github.com/NixOS/nixpkgs/issues/150655)
BAZEL_CXXOPTS = "-x:c++";
buildInputs = lib.optional pkgs.stdenv.isDarwin darwin.cctools;
# END Config to build Bazel 6
# Name for the shell
name = "run_nix_shell_shell";
# ... which makes available the following dependencies,
packages = [ bazel_6 bazel-buildtools cacert gcc nix git openssh ];
};
});
}