-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathshell.nix
44 lines (39 loc) · 1.43 KB
/
shell.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
{ pkgs ? import <nixpkgs> {}}:
let
# Uses this folder as the source for esp-rs-nix (in-repo nix-shell)
esp-rs-src = pkgs.lib.sources.cleanSource ./.;
# Examples for out-of-repo nix-shell usage below.
#
# # Use the latest release of esp-rs-nix
# esp-rs-src = builtins.fetchTarball "https://github.com/leighleighleigh/esp-rs-nix/archive/master.tar.gz";
#
# # Use a pinned release of esp-rs-nix, at commit '0c3fa7245d38019e60c4ae56b2e98465c1b8a5dc'
# esp-rs-src = pkgs.fetchFromGitHub {
# owner = "leighleighleigh";
# repo = "esp-rs-nix";
# rev = "0c3fa7245d38019e60c4ae56b2e98465c1b8a5dc";
# hash = "sha256-b5kb6gxqutHySWEoweNfKbZw1r7DkwqRC39RWsyFSLU=";
# };
# Call the package from wherever the source was obtained
esp-rs = pkgs.callPackage "${esp-rs-src}/esp-rs/default.nix" {};
in
pkgs.mkShell rec {
name = "esp-rs-nix";
# You may wish to change these build inputs for your application
buildInputs = [
esp-rs
pkgs.rustup
pkgs.espflash
pkgs.rust-analyzer
pkgs.pkg-config
pkgs.stdenv.cc
pkgs.systemdMinimal
];
shellHook = ''
# Add a prefix 'esp-rs' to the shell prompt
export PS1="(esp-rs)$PS1"
# This variable is important - it tells rustup where to find the esp toolchain,
# without needing to copy it into your local ~/.rustup/ folder.
export RUSTUP_TOOLCHAIN=${esp-rs}
'';
}