]> patrickod personal git archive - keywing-rs.git/blob - shell.nix
Add nix & direnv rust environment configuration
[keywing-rs.git] / shell.nix
1 let
2   rust-version = "1.46.0";
3
4   nixpkgs = fetchGit {
5     url = "https://github.com/patrickod/nixpkgs.git";
6     rev = "8bb6ca5f0a93bb0b9264b50a8c56431c7c7cc591";
7     ref = "personal";
8   };
9
10   mozilla-overlay =
11     import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz);
12
13   pkgs = import nixpkgs {
14     overlays = [ mozilla-overlay ];
15   };
16
17   targets = [
18     "x86_64-unknown-linux-gnu"
19     "thumbv7em-none-eabihf"
20   ];
21
22 in
23   pkgs.mkShell {
24     name = "rust-dev";
25     nativeBuildInputs = with pkgs; [
26       (rustChannels.stable.rust.override {
27         targets = targets;
28         extensions = [
29           "rust-src"
30           "rust-analysis"
31           "rls-preview"
32         ];
33       })
34       gcc-arm-embedded
35       cargo-hf2
36       rustup
37     ];
38   }