X-Git-Url: https://git.patrickod.com/blog/commit/?a=blobdiff_plain;f=flake.nix;fp=flake.nix;h=20b8f1abc65353c4cb23818cee3f66887a876271;hb=7b363ff299aa4caf985392e76033df6a36606410;hp=0000000000000000000000000000000000000000;hpb=c4653c0bb99d718ffc296f20ba5c9e5dca0b284a;p=keywing-rs.git diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..20b8f1a --- /dev/null +++ b/flake.nix @@ -0,0 +1,39 @@ +{ + description = "rust ARM M-0 development"; + inputs = { + nixpkgs.url = "path:/home/patrickod/code/nixpkgs"; + rust-overlay.url = "github:oxalica/rust-overlay"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem (system: + let + overlays = [ (import rust-overlay) ]; + pkgs = import nixpkgs { + inherit system overlays; + }; + rust = pkgs.rust-bin.nightly.latest.default.override { + extensions = [ + "clippy-preview" + "rust-src" + "rustfmt-preview" + ]; + targets = [ + "thumbv7em-none-eabihf" + ]; + }; + in + { + devShell = pkgs.mkShell { + buildInputs = [ + pkgs.gcc-arm-embedded + pkgs.probe-run + pkgs.flip-link + pkgs.cargo-hf2 + rust + ]; + }; + } + ); +}