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 = {