feat: lock down to using the specific rust version

This commit is contained in:
silver 2025-03-10 20:17:55 +00:00
parent 76cddde36d
commit 421d425f5d
Signed by untrusted user: silver
GPG key ID: 36F93D61BAD3FD7D

View file

@ -20,6 +20,7 @@
}: }:
utils.lib.eachDefaultSystem ( utils.lib.eachDefaultSystem (
system: let system: let
overrides = (builtins.fromTOML (builtins.readFile ./rust-toolchain.toml));
pkgs = (import nixpkgs) {inherit system;}; pkgs = (import nixpkgs) {inherit system;};
naersk' = pkgs.callPackage naersk {}; naersk' = pkgs.callPackage naersk {};
package_name = "skynet_discord_bot"; package_name = "skynet_discord_bot";
@ -62,7 +63,15 @@
# `nix develop` # `nix develop`
devShell = pkgs.mkShell { 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 = { nixosModule = {