-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
42 lines (34 loc) · 1.06 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
{ pkgs ? import <nixpkgs> {}}:
let
rustupToolchain = "nightly";
rustBuildTargetTripple = "arm-unknown-linux-gnueabh";
rustBuildHostTripple = "x86_64-unknown-linux-gnu";
arm-cross = import pkgs.path {
crossSystem = {
config = "arm-unknown-linux-gnueabh";
};
};
arm_ld = mips-cross.stdenv.cc;
in
pkgs.mkShell rec {
buildInputs = with pkgs; [
rustup
arm_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
'';
}