forked from project-oak/oak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
86 lines (86 loc) · 2.64 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{
description = "oak";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11";
flake-utils.url = "github:numtide/flake-utils";
gomod2nix.url = "github:nix-community/gomod2nix";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, nixpkgs, flake-utils, gomod2nix, rust-overlay }:
(flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
gomod2nix.overlays.default
rust-overlay.overlays.default
];
config = {
android_sdk.accept_license = true; # accept all of the sdk licenses
allowUnfree = true; # needed to get android stuff to compile
};
};
in
{
packages = { };
devShells = rec {
rust = with pkgs; mkShell {
packages = [
(rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
extensions = [
"clippy"
"llvm-tools-preview"
"rust-src"
"rustfmt"
];
targets = [
"wasm32-unknown-unknown"
"x86_64-unknown-linux-musl"
"x86_64-unknown-none"
];
}))
cargo-deadlinks
cargo-binutils
cargo-deny
cargo-nextest
cargo-udeps
protobuf
qemu_kvm
];
};
lint = with pkgs; mkShell {
packages = [
hadolint
cargo-deadlinks
nodePackages.prettier
nodePackages.prettier-plugin-toml
nixpkgs-fmt
];
};
bazel = with pkgs; mkShell {
shellHook = ''
export ANDROID_BASE_DIR=$(dirname $(dirname $(which android)))
export ANDROID_HOME=$ANDROID_BASE_DIR/libexec/android-sdk
'';
packages = [
jdk11
bazel_6
(androidenv.composeAndroidPackages {
includeNDK = false;
platformVersions = [ "30" "32" ];
buildToolsVersions = [ "30.0.0" ];
}).androidsdk
bazel_6
];
};
default = with pkgs; mkShell {
inputsFrom = [
rust
bazel
lint
];
};
};
}));
}