{ pkgs, lib, ... }: let libs = with pkgs; [ openssl ]; in { env = { LD_LIBRARY_PATH = lib.makeLibraryPath libs; # MIRIFLAGS = "-Zmiri-disable-isolation"; # RUST_BACKTRACE = "1"; }; packages = with pkgs; [ bacon cargo-audit cargo-criterion cargo-deny cargo-nextest cargo-watch gnuplot nixfmt mold ] ++ libs ++ lib.optionals stdenv.isDarwin (with pkgs.darwin.apple_sdk; [ frameworks.Security ]); languages.rust = { enable = true; channel = "nightly"; components = [ "rustc" "cargo" "clippy" "rustfmt" "rust-analyzer" "rust-docs" "rust-src" "miri" ]; }; pre-commit.hooks = { shellcheck.enable = true; rustfmt.enable = true; clippy.enable = true; }; scripts = { watch.exec = "cargo watch -q -c -w src/ -x 'run -q'"; test.exec = "cargo nextest run"; bench.exec = "cargo bench"; }; }