-
Notifications
You must be signed in to change notification settings - Fork 74
/
flake.nix
42 lines (39 loc) · 1.45 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
34
35
36
37
38
39
40
41
42
{
description = "turbo-cache";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = inputs@{ nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];
perSystem = { config, self', inputs', pkgs, system, ... }:
let
# Link OpenSSL statically into the openssl-sys crate.
openssl_static = pkgs.openssl.override { static = true; };
# Wrap Bazel so that the Cargo build can see OpenSSL from nixpkgs.
bazel = import ./tools/wrapped-bazel.nix {
openssl = openssl_static;
bazel = pkgs.bazel;
writeShellScriptBin = pkgs.writeShellScriptBin;
};
in
{
devShells.default = pkgs.mkShell {
nativeBuildInputs = [
# Development tooling goes here.
pkgs.cargo
openssl_static # Required explicitly for cargo test support.
bazel
];
shellHook = ''
# The Bazel and Cargo builds in nix require a Clang toolchain.
# TODO(aaronmondal): The Bazel build currently uses the
# irreproducible host C++ toolchain. Provide
# this toolchain via nix for bitwise identical
# binaries across machines.
export CC=clang
'';
};
};
};
}