-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Please make sure there is an issue that this PR is correlated to. --> Fixes RVT-3953 ## Changes <!-- If there are frontend changes, please include screenshots. -->
- Loading branch information
1 parent
9457bee
commit eaee5a5
Showing
1 changed file
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Cross-platform Rust Setup: https://zeroes.dev/p/nix-recipe-for-rust/ | ||
|
||
let | ||
# Pull new Rust packages | ||
moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/9b11a87c0cc54e308fa83aac5b4ee1816d5418a2.tar.gz); | ||
|
||
# Overlay package | ||
pkgs = import (fetchTarball { | ||
url = "https://github.com/NixOS/nixpkgs/archive/refs/tags/23.05.tar.gz"; | ||
}) { overlays = [ moz_overlay ]; }; | ||
in | ||
pkgs.mkShell { | ||
name = "rivet"; | ||
|
||
buildInputs = with pkgs; [ | ||
# Tools | ||
cloc | ||
curl | ||
docker-client # Standardize client CLI since older clients have breaking changes | ||
git-lfs | ||
jq | ||
openssh # ssh-keygen | ||
|
||
python310Packages.detect-secrets | ||
|
||
# Compilers | ||
clang | ||
llvm | ||
lld | ||
pkg-config | ||
pkgs.latest.rustChannels.stable.rust | ||
|
||
# Libraries | ||
openssl | ||
|
||
# Autocomplete | ||
bashInteractive | ||
bash-completion | ||
|
||
# Utilities | ||
netcat | ||
|
||
# Fixes "cannot change locale" warning | ||
glibcLocales | ||
] | ||
++ extraInputs | ||
++ ( | ||
pkgs.lib.optionals stdenv.isDarwin [ | ||
libiconv # See https://stackoverflow.com/a/69732679 | ||
darwin.apple_sdk.frameworks.Security | ||
darwin.apple_sdk.frameworks.CoreServices | ||
darwin.apple_sdk.frameworks.CoreFoundation | ||
darwin.apple_sdk.frameworks.Foundation | ||
] | ||
); | ||
shellHook = '' | ||
# Setup Git LFS | ||
git lfs install --manual > /dev/null | ||
# Install autocomplete | ||
source ${pkgs.bash-completion}/share/bash-completion/bash_completion | ||
# Fix dynamic library path to fix issue with Python | ||
export LD_LIBRARY_PATH="${pkgs.clang}/resource-root/lib:${pkgs.lib.strings.makeLibraryPath [ pkgs.openssl ]}" | ||
# Set default Rust flags to match the Rust flags used inside of Bolt. | ||
# | ||
# If these don't match, then the build cache is purged any time Rust is ran from Bolt. | ||
export RUSTFLAGS="--cfg tokio_unstable" | ||
''; | ||
} |