Skip to content

Instantly share code, notes, and snippets.

@ydm
Created March 9, 2023 13:24
Show Gist options
  • Select an option

  • Save ydm/87fc9649b26b2aaa48ba59657d4d4b4e to your computer and use it in GitHub Desktop.

Select an option

Save ydm/87fc9649b26b2aaa48ba59657d4d4b4e to your computer and use it in GitHub Desktop.
Custom Rust version
{
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-22.05;
flake-utils.url = github:numtide/flake-utils;
rust-overlay.url = github:oxalica/rust-overlay;
};
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
flake-utils.lib.simpleFlake {
inherit self nixpkgs;
name = "Rust environment";
preOverlays = [rust-overlay.overlays.default];
shell = ./shell.nix;
};
}
{ pkgs }:
with pkgs;
let rust = rust-bin.stable."1.62.0".default.override {
extensions = [ "rust-src" ];
};
in mkShell {
packages = [
clang
cmake
libclang
perl
pkg-config
protobuf
rust
];
shellHook = ''
export LIBCLANG_PATH="${libclang.lib}/lib"
echo
echo shell.nix: loaded
echo
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment