add nixos shell

This commit is contained in:
foosinn 2021-07-11 00:27:17 +02:00
parent 91f01c0b62
commit 82d7df7146
3 changed files with 25 additions and 0 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
eval "$(lorri direnv)"

4
rust-toolchain Normal file
View File

@ -0,0 +1,4 @@
[toolchain]
channel = "stable"
components = [ "rust-src" ]
targets = [ "thumbv6m-none-eabi" ]

20
shell.nix Normal file
View File

@ -0,0 +1,20 @@
# Use nixpkgs with oxalica rust-bin overlay
let
rust_overlay = import (builtins.fetchTarball
"https://github.com/oxalica/rust-overlay/archive/master.tar.gz");
nixpkgs = import <nixpkgs> { overlays = [ rust_overlay ]; };
rust_channel = nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain;
in
# Avoid typing `nixpkgs.` before each package name
with nixpkgs;
# Define the shell
pkgs.mkShell {
buildInputs = [
dfu-util
];
nativeBuildInputs = [
rust_channel # Full rust from overlay, includes cargo
];
}