-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
48 lines (46 loc) · 1.25 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
{
description = "A basic flake with a shell";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.naersk.url = "github:nix-community/naersk";
inputs.rust-overlay.url = "github:oxalica/rust-overlay";
outputs = {
self,
nixpkgs,
flake-utils,
naersk,
rust-overlay,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [(import rust-overlay)];
};
rust = pkgs.rust-bin.selectLatestNightlyWith (toolchain:
toolchain.default.override {
targets = ["riscv64gc-unknown-none-elf"];
});
naersk' = pkgs.callPackage naersk {
cargo = rust;
rustc = rust;
};
in {
devShell = pkgs.mkShell {
nativeBuildInputs =
(with pkgs; [
rust
just
python3
cargo-binutils
qemu
ripgrep-all
])
++ (with pkgs.pkgsCross.riscv64.buildPackages; [
gcc
]);
RUST_PATH = "${rust}";
RUST_DOC_PATH = "${rust}/share/doc/rust/html/std/index.html";
};
defaultPackage = naersk'.buildPackage ./.;
});
}