diff --git a/Cargo.toml b/Cargo.toml index 1f35143..71059fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,9 @@ license = "MIT OR Apache-2.0" version = "0.1.0" authors = ["Fintan Halpenny "] edition = "2021" +# N.B. always use the full semver so that rust-overlay in `flake.nix` can select +# the correct version +rust-version = "1.82.0" [dependencies] indexmap = { version = "2.7.1", features = ["serde"] } diff --git a/flake.lock b/flake.lock index 45f8812..eea34c9 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1742394900, - "narHash": "sha256-vVOAp9ahvnU+fQoKd4SEXB2JG2wbENkpqcwlkIXgUC0=", + "lastModified": 1747260204, + "narHash": "sha256-KUb6MFWc2DYeTCmcEkrBrrqhxAgO6NHZh5qQKwsjG6I=", "owner": "ipetkov", "repo": "crane", - "rev": "70947c1908108c0c551ddfd73d4f750ff2ea67cd", + "rev": "7f85510df37247c86a0c44032f49aa18292ee11f", "type": "github" }, "original": { @@ -35,11 +35,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1742998488, - "narHash": "sha256-r7dqSLNkzg1rOPsq4Tuc6p+UtAGqNRMma4riupsuZv4=", + "lastModified": 1747308931, + "narHash": "sha256-aFP8PqwBbokBQ6IKpD71RbhSWV4qjyg6M0y62rodRts=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8e0b1e9c8c4dfaef0ff85e09c91294ba4afa4168", + "rev": "ed8ec80540abb9a7e69da65916cf3d0b26174555", "type": "github" }, "original": { @@ -64,11 +64,11 @@ ] }, "locked": { - "lastModified": 1742956365, - "narHash": "sha256-Slrqmt6kJ/M7Z/ce4ebQWsz2aeEodrX56CsupOEPoz0=", + "lastModified": 1747190175, + "narHash": "sha256-s33mQ2s5L/2nyllhRTywgECNZyCqyF4MJeM3vG/GaRo=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "a0e3395c63cdbc9c1ec17915f8328c077c79c4a1", + "rev": "58160be7abad81f6f8cb53120d5b88c16e01c06d", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 72c50bc..ba7578d 100644 --- a/flake.nix +++ b/flake.nix @@ -29,7 +29,10 @@ overlays = [(import rust-overlay)]; }; - rustToolChain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; + # Get the `rust-version` from the Cargo manifest + manifest = builtins.fromTOML (builtins.readFile ./Cargo.toml); + rust-version = manifest.package.rust-version; + rustToolChain = pkgs.rust-bin.stable.${rust-version}.default; craneLib = (crane.mkLib pkgs).overrideToolchain rustToolChain; src = lib.cleanSourceWith { @@ -99,6 +102,7 @@ # Extra inputs can be added here; cargo and rustc are provided by default # from the toolchain that was specified earlier. packages = with pkgs; [ + cargo-nextest cargo-watch ripgrep rust-analyzer diff --git a/rust-toolchain.toml b/rust-toolchain.toml deleted file mode 100644 index ba99c25..0000000 --- a/rust-toolchain.toml +++ /dev/null @@ -1,4 +0,0 @@ -[toolchain] -channel = "1.84" -profile = "default" -components = [ "rust-src" ]