From: Patrick O'Doherty Date: Mon, 12 Jul 2021 05:02:54 +0000 (-0700) Subject: base flake.nix & direnv configuration for editors X-Git-Url: https://git.patrickod.com/noisetor.ansible/tree?a=commitdiff_plain;h=0c4201c35eed75b16a44bb5a1054d1a6e9d5e5aa;p=tincan.git base flake.nix & direnv configuration for editors add - flake.nix w/ rust, gcc-arm-embedded, & cargo utilities - add .envrc for direnv configuration (emacs, vscode, etc..) - add .direnv to .gitignore to prevent cross-contamination --- diff --git a/.gitignore b/.gitignore index 756e9c6..b51e51a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ target .*.sw? +.direnv diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..6b6c79b --- /dev/null +++ b/flake.lock @@ -0,0 +1,92 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1623875721, + "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1614513358, + "narHash": "sha256-LakhOx3S1dRjnh0b5Dg3mbZyH0ToC9I8Y2wKSkBaTzU=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5466c5bbece17adaab2d82fae80b46e807611bf3", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1625950041, + "narHash": "sha256-AG5nHJFa5ZYTS4XvPIQjLp6PRDaXw8ufzuSgQrsPFxk=", + "owner": "patrickod", + "repo": "nixpkgs", + "rev": "8526fbfca0d4a6cff72d85844e02ae0c8dbbfee2", + "type": "github" + }, + "original": { + "owner": "patrickod", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1617325113, + "narHash": "sha256-GksR0nvGxfZ79T91UUtWjjccxazv6Yh/MvEJ82v1Xmw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "54c1e44240d8a527a8f4892608c4bce5440c3ecb", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1626055976, + "narHash": "sha256-JWqjfR0eeE505Xp26d3z/0T8+YljjHlS8VX/yCknskY=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "ecb9af08bc7ce17a4c51378c7a301925d4c4344c", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..d9ef43b --- /dev/null +++ b/flake.nix @@ -0,0 +1,39 @@ +{ + description = "rust ARM M-0 development"; + inputs = { + nixpkgs.url = "github:patrickod/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" + "rust-analyzer-preview" + ]; + targets = [ + "thumbv6m-none-eabi" + ]; + }; + in + { + devShell = pkgs.mkShell { + buildInputs = [ + pkgs.gcc-arm-embedded + pkgs.probe-run + pkgs.cargo-hf2 + rust + ]; + }; + } + ); +}