From 7ce059e5d42136d3aedd7c33fe6ec0d346c4b678 Mon Sep 17 00:00:00 2001 From: Frederik Menke Date: Thu, 4 Jul 2024 20:32:50 +0200 Subject: [PATCH] Config build --- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 27 +++++++++++++++++++++++++++ rust-toolchain-nightly.toml | 12 ++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 rust-toolchain-nightly.toml diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..2fac8de --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1719075281, + "narHash": "sha256-CyyxvOwFf12I91PBWz43iGT1kjsf5oi6ax7CrvaMyAo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "a71e967ef3694799d0c418c98332f7ff4cc5f6af", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..2a77f92 --- /dev/null +++ b/flake.nix @@ -0,0 +1,27 @@ +{ + description = "Shell environment for building this package"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + }; + + outputs = { + self, + nixpkgs, + }: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in { + devShells.${system}.default = + pkgs.mkShell rec + { + buildInputs = with pkgs; [ + pkg-config + probe-rs + ]; + + LD_LIBRARY_PATH = + builtins.foldl' (a: b: "${a}:${b}/lib") "${pkgs.vulkan-loader}/lib" buildInputs; + }; + }; +} diff --git a/rust-toolchain-nightly.toml b/rust-toolchain-nightly.toml new file mode 100644 index 0000000..d965d67 --- /dev/null +++ b/rust-toolchain-nightly.toml @@ -0,0 +1,12 @@ +[toolchain] +channel = "nightly-2024-06-18" +components = [ "rust-src", "rustfmt", "llvm-tools", "miri" ] +targets = [ + "thumbv7em-none-eabi", + "thumbv7m-none-eabi", + "thumbv6m-none-eabi", + "thumbv7em-none-eabihf", + "thumbv8m.main-none-eabihf", + "riscv32imac-unknown-none-elf", + "wasm32-unknown-unknown", +]