From 2a0a8faea3418582f0a37172f9d9f17e1edaf4d8 Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Tue, 17 Dec 2024 17:23:47 +0800 Subject: [PATCH] chore: improve nix-shell support --- rust-toolchain.toml | 1 + shell.nix | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index c986eedd9716..d12222a5d332 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,3 @@ [toolchain] channel = "nightly-2024-10-19" +components = ["rust-analyzer"] diff --git a/shell.nix b/shell.nix index b255fe845c76..ca97838bf313 100644 --- a/shell.nix +++ b/shell.nix @@ -4,19 +4,23 @@ let pkgs = import nixpkgs { config = {}; overlays = []; }; in -pkgs.mkShellNoCC { - packages = with pkgs; [ +pkgs.mkShell rec { + nativeBuildInputs = with pkgs; [ git clang gcc - mold - libgit2 protobuf + mold (fenix.fromToolchainFile { dir = ./.; }) - fenix.rust-analyzer cargo-nextest + taplo + ]; + + buildInputs = with pkgs; [ + libgit2 ]; + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs; }