diff --git a/rust/flake.nix b/rust/flake.nix index 97f1b46..7602efa 100644 --- a/rust/flake.nix +++ b/rust/flake.nix @@ -13,10 +13,16 @@ overlays = [ (import rust-overlay) ]; pkgs = import nixpkgs { inherit system overlays; }; + inherit (pkgs) rust-bin; - rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; + rust = if builtins.pathExists ./rust-toolchain.toml then + rust-bin.fromRustupToolchainFile ./rust-toolchain.toml + else if builtins.pathExists ./rust-toolchain then + rust-bin.fromRustupToolchainFile ./rust-toolchain + else + rust-bin.stable.latest.default; - helpers = with pkgs; [ openssl pkg-config ]; + helpers = with pkgs; [ openssl pkgconfig ]; inherit (pkgs) mkShell; inherit (pkgs.lib) optionals; @@ -26,7 +32,9 @@ devShells = { default = mkShell { - buildInputs = [ rust ] ++ helpers; + nativeBuildInputs = [ rust ]; + + buildInputs = helpers; shellHook = '' ${rust}/bin/cargo --version diff --git a/rust/rust-toolchain.toml b/rust/rust-toolchain.toml deleted file mode 100644 index 05dfa32..0000000 --- a/rust/rust-toolchain.toml +++ /dev/null @@ -1,2 +0,0 @@ -[toolchain] -channel = "1.62.0"