From 34fbe7739e5bf2c1f10d4f0435d0fd1b3cc2bed3 Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Mon, 16 Dec 2024 19:47:18 +0800 Subject: [PATCH] chore: add nix-shell configure for a minimal environment for development (#5175) * chore: add nix-shell development environment * chore: add rust-analyzer * chore: use .envrc as a private file --- .gitignore | 6 +++++- shell.nix | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 shell.nix diff --git a/.gitignore b/.gitignore index c1b0a89618..5823287889 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,10 @@ benchmarks/data venv/ -# Fuzz tests +# Fuzz tests tests-fuzz/artifacts/ tests-fuzz/corpus/ + +# Nix +.direnv +.envrc diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000000..b255fe845c --- /dev/null +++ b/shell.nix @@ -0,0 +1,22 @@ +let + nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-unstable"; + fenix = import (fetchTarball "https://github.com/nix-community/fenix/archive/main.tar.gz") {}; + pkgs = import nixpkgs { config = {}; overlays = []; }; +in + +pkgs.mkShellNoCC { + packages = with pkgs; [ + git + clang + gcc + mold + libgit2 + protobuf + (fenix.fromToolchainFile { + dir = ./.; + }) + fenix.rust-analyzer + cargo-nextest + ]; + +}