-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
54 lines (47 loc) · 1.57 KB
/
shell.nix
File metadata and controls
54 lines (47 loc) · 1.57 KB
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
{ pkgs ? import <nixpkgs> {}}:
let
esp-rs-src = builtins.fetchGit {
url = "https://github.com/leighleighleigh/esp-rs-nix";
# mainline
rev = "8baa40f096e7f52a10e8438b0bd55ef5dc280164";
# openocd but with tweaks
#rev = "ffe1451dcbda038ff117e7b85ac11608406f795e";
};
# This will build esp-rs-src, chosen above
esp-rs = pkgs.callPackage "${esp-rs-src}/esp-rs/default.nix" {
pkgs = pkgs;
version = "1.88.0.0"; # Rust version
crosstool-version = "15.2.0_20251204"; # Cross-compiler toolchain version (GCC)
binutils-version = "16.3_20250913"; # Binutils version (GDB)
};
# OpenOCD fork
#esp-openocd = pkgs.callPackage "${esp-rs-src}/esp-rs/esp-openocd.nix" {};
in
pkgs.mkShell rec {
name = "esp-rs-nix";
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = [
esp-rs
#esp-openocd
#pkgs.espflash
#pkgs.rust-analyzer
#pkgs.rustup
pkgs.stdenv.cc
pkgs.just
pkgs.inotify-tools
pkgs.picocom
pkgs.libusb1
# for libudev
pkgs.systemdMinimal
];
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath buildInputs}";
shellHook = ''
# set the shell logline or whatever it's called
export PS1="''${debian_chroot:+($debian_chroot)}\[\033[01;39m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ "
export PS1="(esp-hal-ulp-tests)$PS1"
# Load shell completions for espflash
if (which espflash >/dev/null 2>&1); then
. <(espflash completions $(basename $SHELL))
fi
'';
}