-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
59 lines (52 loc) · 1.82 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
description = "HobbyOS";
inputs = {
# https://github.com/NixOS/nixpkgs/releases/tag/23.05
nixpkgs.url = "github:NixOS/nixpkgs/4ecab3273592f27479a583fb6d975d4aba3486fe";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system: {
devShell = (let
inherit system;
pkgs = nixpkgs.legacyPackages.${system};
in pkgs.mkShell {
buildInputs = with pkgs; [
bazelisk
bazel-buildtools
binutils
coreutils-full
curlFull
stdenv.cc.cc.lib
gcc-unwrapped.lib
llvmPackages_15.llvm
llvmPackages_15.libclang
llvmPackages_15.libcxxabi
lld_15
git
gnutar
perl
libiconv
nixFlakes
pkg-config
which
xcbuild
xorriso
];
shellHook = ''
# patch binary from toybox breaks some of bazel repository rules when running `bazel sync`
# override path to force use of gnupatch instead
export PATH="${pkgs.gnupatch}/bin:''${PATH}"
export WORKSPACE_ROOT="`pwd`"
# Store debug output in a separate directory
BAZEL_DEBUG="''${WORKSPACE_ROOT}/bazel-debug"
if [ ! -d "''${BAZEL_DEBUG}" ]; then mkdir -p "''${BAZEL_DEBUG}"; fi
source ${pkgs.bash-completion}/etc/profile.d/bash_completion.sh
'';
});
});
}