From: Patrick O'Doherty
Date: Fri, 4 Sep 2020 23:13:51 +0000 (-0700) Subject: Add nix & direnv rust environment configuration X-Git-Url: https://git.patrickod.com/vpn/diff/?a=commitdiff_plain;h=ae7e9009c24193d06daa77bdfcde9caeb37053e4;p=keywing-rs.git Add nix & direnv rust environment configuration --- diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..051d09d --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +eval "$(lorri direnv)" diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..19b7c15 --- /dev/null +++ b/shell.nix @@ -0,0 +1,38 @@ +let + rust-version = "1.46.0"; + + nixpkgs = fetchGit { + url = "https://github.com/patrickod/nixpkgs.git"; + rev = "8bb6ca5f0a93bb0b9264b50a8c56431c7c7cc591"; + ref = "personal"; + }; + + mozilla-overlay = + import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz); + + pkgs = import nixpkgs { + overlays = [ mozilla-overlay ]; + }; + + targets = [ + "x86_64-unknown-linux-gnu" + "thumbv7em-none-eabihf" + ]; + +in + pkgs.mkShell { + name = "rust-dev"; + nativeBuildInputs = with pkgs; [ + (rustChannels.stable.rust.override { + targets = targets; + extensions = [ + "rust-src" + "rust-analysis" + "rls-preview" + ]; + }) + gcc-arm-embedded + cargo-hf2 + rustup + ]; + }