From 81e7c3f9cea28d1bfb67b2939243292181c68d96 Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Sun, 15 Dec 2024 23:49:18 -0800 Subject: [PATCH 1/3] chore: add nix-shell development environment --- .envrc | 1 + .gitignore | 5 ++++- shell.nix | 21 +++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .envrc create mode 100644 shell.nix diff --git a/.envrc b/.envrc new file mode 100644 index 000000000000..bcc84d80ac79 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use nix --pure diff --git a/.gitignore b/.gitignore index c1b0a8961845..c7f23257994a 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,9 @@ benchmarks/data venv/ -# Fuzz tests +# Fuzz tests tests-fuzz/artifacts/ tests-fuzz/corpus/ + +# Nix +.direnv diff --git a/shell.nix b/shell.nix new file mode 100644 index 000000000000..942c1705dacd --- /dev/null +++ b/shell.nix @@ -0,0 +1,21 @@ +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 = ./.; + }) + cargo-nextest + ]; + +} From 3a864e4c5bace832c95d43ae1f3dc1e4d09a6498 Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Mon, 16 Dec 2024 00:18:39 -0800 Subject: [PATCH 2/3] chore: add rust-analyzer --- shell.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/shell.nix b/shell.nix index 942c1705dacd..b255fe845c76 100644 --- a/shell.nix +++ b/shell.nix @@ -15,6 +15,7 @@ pkgs.mkShellNoCC { (fenix.fromToolchainFile { dir = ./.; }) + fenix.rust-analyzer cargo-nextest ]; From bfc76ee12d125ce24badc4f072ef8ba978b6d80e Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Mon, 16 Dec 2024 00:24:55 -0800 Subject: [PATCH 3/3] chore: use .envrc as a private file --- .envrc | 1 - .gitignore | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 .envrc diff --git a/.envrc b/.envrc deleted file mode 100644 index bcc84d80ac79..000000000000 --- a/.envrc +++ /dev/null @@ -1 +0,0 @@ -use nix --pure diff --git a/.gitignore b/.gitignore index c7f23257994a..5823287889aa 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,4 @@ tests-fuzz/corpus/ # Nix .direnv +.envrc