this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 68 lines 2.1 kB view raw
1{ 2 description = "A Nix-flake-based Rust development environment"; 3 4 inputs = { 5 nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz"; 6 rust-overlay = { 7 url = "github:oxalica/rust-overlay"; 8 inputs.nixpkgs.follows = "nixpkgs"; 9 }; 10 }; 11 12 outputs = { self, nixpkgs, rust-overlay }: 13 let 14 supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; 15 forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { 16 pkgs = import nixpkgs { 17 inherit system; 18 overlays = [ rust-overlay.overlays.default self.overlays.default ]; 19 }; 20 }); 21 in 22 { 23 overlays.default = final: prev: { 24 rustToolchain = 25 let 26 rust = prev.rust-bin; 27 in 28 if builtins.pathExists ./rust-toolchain.toml then 29 rust.fromRustupToolchainFile ./rust-toolchain.toml 30 else if builtins.pathExists ./rust-toolchain then 31 rust.fromRustupToolchainFile ./rust-toolchain 32 else 33 rust.stable.latest.default.override { 34 extensions = [ "rust-src" "rustfmt" ]; 35 }; 36 }; 37 38 devShells = forEachSupportedSystem ({ pkgs }: { 39 default = pkgs.mkShell { 40 buildInputs = with pkgs; [ 41 rustToolchain 42 openssl 43 pkg-config 44 cargo-deny 45 cargo-edit 46 cargo-watch 47 cargo-nextest 48 rust-analyzer 49 jq 50 51 # for local testing 52 kind 53 kubectl 54 kubebuilder 55 ]; 56 57 env = { 58 # Required by rust-analyzer 59 RUST_SRC_PATH = "${pkgs.rustToolchain}/lib/rustlib/src/rust/library"; 60 PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig;${pkgs.libxkbcommon.dev}/lib/pkgconfig;"; 61 OPENSSL_NO_VENDOR = 1; 62 OPENSSL_LIB_DIR = "${pkgs.lib.getLib pkgs.openssl}/lib"; 63 OPENSSL_DIR = "${pkgs.openssl.dev}"; 64 }; 65 }; 66 }); 67 }; 68}