Last active
July 9, 2025 16:54
-
-
Save jjyr/a1fa3617024a8bded5532db5002e0d2f to your computer and use it in GitHub Desktop.
nix shell for rust projects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
pkgs ? import <nixpkgs> { }, | |
... | |
}: | |
let | |
fenix = import (fetchTarball "https://github.com/nix-community/fenix/archive/main.tar.gz") { }; | |
rustToolchain = fenix.fromToolchainFile { dir = ./.; }; | |
in | |
pkgs.mkShell { | |
buildInputs = with pkgs; [ | |
clang | |
clang-tools | |
rustToolchain | |
]; | |
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib"; | |
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment