/* based on https://discourse.nixos.org/t/how-can-i-set-up-my-rust-programming-environment/4501/9 */ let rust_overlay = import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"); pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/06278c77b5d162e62df170fec307e83f1812d94b.tar.gz") { overlays = [ rust_overlay ]; }; #rustVersion = "latest"; rustVersion = "1.73.0"; rust = pkgs.rust-bin.stable.${rustVersion}.default.override { extensions = [ "rust-src" # for rust-analyzer ]; }; in pkgs.mkShell { buildInputs = [ rust ] ++ (with pkgs; [ pkg-config openssl rust-analyzer cargo rustfmt clippy ]); PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig"; RUST_BACKTRACE = 1; }