Skip to content

Instantly share code, notes, and snippets.

@jjyr
Last active July 9, 2025 16:54
Show Gist options
  • Save jjyr/a1fa3617024a8bded5532db5002e0d2f to your computer and use it in GitHub Desktop.
Save jjyr/a1fa3617024a8bded5532db5002e0d2f to your computer and use it in GitHub Desktop.
nix shell for rust projects
{
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