Creating a Nix shell for Rust development is easy if you’re prepared to either use only stable Rust or use Rustup to manage your Rust toolchain. But the latest version of Bevy was not compatible with stable Rust at the time of writing, and using Rustup would sacrifice one of the biggest advantages of Nix: having reproducibility managed by a single component. I’m pretty happy with what I ended up with, so here’s the gist of what you need. Devenv setup devenv.yaml needs nixpkgs and an overlay to install nightly Rust: --- inputs: nixpkgs: url: github:NixOS/nixpkgs/nixpkgs-unstable rust-overlay: url: github:oxalica/rust-overlay inputs: nixpkgs: follows: nixpkgs devenv.nix needs to install and make libraries available for consumption during the project build: { lib, pkgs, options, ... }: let libraries = [ # Omitted project specific packages ]; in { packages = [ # Omitted project specific packages ] ++ libraries; env.LD_LIBRARY_PATH = lib.makeLibraryPath libraries; languages = { nix.enable…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.