-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
45 lines (37 loc) · 1.08 KB
/
default.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
{ pkgs ? import <nixpkgs> {}}:
let
rustupToolchain = "nightly";
rustBuildTargetTripple = "mips-unknown-linux-gnu";
rustBuildHostTripple = "x86_64-unknown-linux-gnu";
mips-cross = import pkgs.path {
crossSystem = {
config = "mips-linux-gnu";
};
};
mips_ld = mips-cross.stdenv.cc;
in
pkgs.mkShell rec {
buildInputs = with pkgs; [
rustup
jdk11
zip
unzip
mips_ld
git
#yq
];
RUSTUP_HOME = toString ~/.rustup;
CARGO_HOME = toString ~/.cargo;
RUSTUP_TOOLCHAIN = rustupToolchain;
shellHook = ''
export PATH=$PATH:${CARGO_HOME}/bin
export PATH=$PATH:${RUSTUP_HOME}/toolchains/${rustupToolchain}-${rustBuildHostTripple}/bin/
export PATH=$PATH:${RUSTUP_HOME}/toolchains/${rustupToolchain}-${rustBuildTargetTripple}/bin/
rustup target add "${rustBuildHostTripple}"
rustup target add "${rustBuildTargetTripple}"
rustup component add rust-src --toolchain ${rustupToolchain}-${rustBuildHostTripple}
rustup component add clippy
rustup component add rustfmt
rustup component add llvm-tools-preview
'';
}