From 421d425f5d1300f67b1be8542cde0dc3d501bbf6 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Mon, 10 Mar 2025 20:17:55 +0000 Subject: [PATCH] feat: lock down to using the specific rust version --- flake.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 92eac43..0a37869 100644 --- a/flake.nix +++ b/flake.nix @@ -20,6 +20,7 @@ }: utils.lib.eachDefaultSystem ( system: let + overrides = (builtins.fromTOML (builtins.readFile ./rust-toolchain.toml)); pkgs = (import nixpkgs) {inherit system;}; naersk' = pkgs.callPackage naersk {}; package_name = "skynet_discord_bot"; @@ -62,7 +63,15 @@ # `nix develop` devShell = pkgs.mkShell { - nativeBuildInputs = with pkgs; [rustc cargo pkg-config openssl rustfmt]; + nativeBuildInputs = with pkgs; [rustup rustPlatform.bindgenHook pkg-config openssl]; + # libraries here + buildInputs = [ ]; + RUSTC_VERSION = overrides.toolchain.channel; + # https://github.com/rust-lang/rust-bindgen#environment-variables + shellHook = '' + export PATH="''${CARGO_HOME:-~/.cargo}/bin":"$PATH" + export PATH="''${RUSTUP_HOME:-~/.rustup}/toolchains/$RUSTC_VERSION-${pkgs.stdenv.hostPlatform.rust.rustcTarget}/bin":"$PATH" + ''; }; nixosModule = {