diff --git a/flake.lock b/flake.lock index 52fabf4e2..90a157f69 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "fenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1786348189, + "narHash": "sha256-tnTpFky6/GeXVMBO+hLJK2jWS4J8TYloL+rqRME9gAk=", + "owner": "nix-community", + "repo": "fenix", + "rev": "a0b1aef63d7e9c5568958e0d90f6fe48f0f4a7a2", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -20,16 +41,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1764521362, - "narHash": "sha256-M101xMtWdF1eSD0xhiR8nG8CXRlHmv6V+VoY65Smwf4=", - "owner": "nixos", + "lastModified": 1786313170, + "narHash": "sha256-9BG7OgUWdu0ONDO5X2q6+K4bsuBITkX/3W4nNJu1Ito=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "871b9fd269ff6246794583ce4ee1031e1da71895", + "rev": "fcb8fcd6bf2d0adecae5bd491afaaaf8311b758d", "type": "github" }, "original": { - "owner": "nixos", - "ref": "25.11", + "owner": "NixOS", + "ref": "nixos-26.05", "repo": "nixpkgs", "type": "github" } @@ -50,45 +71,28 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1744536153, - "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "root": { "inputs": { + "fenix": "fenix", "flake-utils": "flake-utils", "nixpkgs": "nixpkgs", - "nixpkgs-bitcoind": "nixpkgs-bitcoind", - "rust-overlay": "rust-overlay" + "nixpkgs-bitcoind": "nixpkgs-bitcoind" } }, - "rust-overlay": { - "inputs": { - "nixpkgs": "nixpkgs_2" - }, + "rust-analyzer-src": { + "flake": false, "locked": { - "lastModified": 1777950921, - "narHash": "sha256-NpOgt8ISaHTDNJZjNUfwFfbieKfRXzab4WKM31gZCGA=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "366ea19e0e55b768f74b7a0b2a20f847e7ae828d", + "lastModified": 1786285255, + "narHash": "sha256-zJukKxGKLxcO7E6+P49Qe6XaSbbyGG44kFvQYLWaD3M=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "57411b3a0fb0181ed5965f6541d5ed39a9d79d4c", "type": "github" }, "original": { - "owner": "oxalica", - "repo": "rust-overlay", + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 4d6435815..d887d0ebe 100644 --- a/flake.nix +++ b/flake.nix @@ -3,16 +3,19 @@ inputs = { # Nixpkgs channel. New channels are released every 6 months. - # See: https://github.com/NixOS/nixpkgs/tags - nixpkgs.url = "github:nixos/nixpkgs/25.11"; + # See: https://github.com/NixOS/nixpkgs/branches + nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05"; # This makes it easy for the flake to be multi-platform. # See: https://github.com/numtide/flake-utils flake-utils.url = "github:numtide/flake-utils"; - # Provides Rust toolchains. - # See: https://github.com/oxalica/rust-overlay - rust-overlay.url = "github:oxalica/rust-overlay"; + # Provides pinned Rust toolchains. + # See: https://github.com/nix-community/fenix + fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; # Pinned nixpkgs that ships bitcoind 27.1. The integration tests' bundled # `corepc-node` deserializes the 27.x `getblockchaininfo` schema, so newer @@ -25,25 +28,20 @@ self, nixpkgs, flake-utils, - rust-overlay, + fenix, nixpkgs-bitcoind, }: flake-utils.lib.eachDefaultSystem ( system: let - # Overlays provide additional packages not available in the channels. - overlays = [ - # Provides the rust-bin package; a set of pre-built Rust toolchains. - (import rust-overlay) - ]; - # The final set of packages. pkgs = import nixpkgs { # Inheriting from system is what makes this multi-platform. - # We also inherit the overlays that we want to use. - inherit system overlays; + inherit system; }; + fenixPkgs = fenix.packages.${system}; + # bitcoind 27.1 from the pinned input (see inputs above). bitcoind = nixpkgs-bitcoind.legacyPackages.${system}.bitcoind; @@ -53,17 +51,23 @@ # deliberately exclude `rustfmt`: this repo's `rustfmt.toml` relies on # nightly-only options, so formatting is supplied by `rustfmt-nightly` # below to keep `just fmt`/`just check` consistent with CI's nightly job. - rust-toolchain = pkgs.rust-bin.stable."1.85.1".minimal.override { - extensions = [ - "rust-src" # Needed for the rust-analyzer extension to work. - "clippy" # Linter used by `just check`. - ]; - }; + rust-toolchain = + (fenixPkgs.toolchainOf { + channel = "1.85.1"; + sha256 = "sha256-Hn2uaQzRLidAWpfmRwSRdImifGUCAb9HeAqTYFXWeQk="; + }).withComponents + [ + "rustc" + "cargo" + "rust-std" + "rust-src" # Needed for the rust-analyzer extension to work. + "clippy" # Linter used by `just check`. + ]; # Nightly rustfmt only. `cargo fmt` shells out to whichever `rustfmt` is # on PATH, so a nightly rustfmt lets the nightly-only options in # `rustfmt.toml` apply even though cargo/rustc are pinned to stable. - rustfmt-nightly = pkgs.rust-bin.nightly.latest.rustfmt; + rustfmt-nightly = fenixPkgs.latest.rustfmt; # Esplora/HTTP electrs for the integration tests' Esplora chain source. #