-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
44 lines (37 loc) · 1.24 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
{
description = "Rust environment for ESP32-C3 development";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" "rustfmt" "clippy" "llvm-tools-preview" ];
targets = [ "riscv32imc-unknown-none-elf" ];
};
espTools = with pkgs; [
cargo-binutils # For objdump, nm, etc.
cargo-generate # Generate templates
espflash # Flash ESP32
ldproxy # Linker
];
embeddedGraphicsSimulation = with pkgs; [
SDL2
];
devPackages = with pkgs; [
pre-commit
];
in {
devShells.default = pkgs.mkShell {
name = "dev";
buildInputs = [ rustToolchain ] ++ espTools ++ embeddedGraphicsSimulation ++ devPackages;
};
});
}