diff --git a/flake.lock b/flake.lock index d661a8e..4785d78 100644 --- a/flake.lock +++ b/flake.lock @@ -1,15 +1,36 @@ { "nodes": { + "fenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1737959729, + "narHash": "sha256-gw2xWck01Pj7evavkDYItQOOlfC7+KeBmfc/ASIRknc=", + "owner": "nix-community", + "repo": "fenix", + "rev": "a77faba92a766d05ed815e3d88f3e0b4cb0731ff", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -20,11 +41,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1723400035, - "narHash": "sha256-WoKZDlBEdMhP+hjquBAh0BhUJbcH2+U8g2mHOr1mv8I=", + "lastModified": 1735563628, + "narHash": "sha256-OnSAY7XDSx7CtDoqNh8jwVwh4xNL/2HaJxGjryLWzX8=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a731b45590a5169542990c36ffcde6cebd9a3356", + "rev": "b134951a4c9f3c995fd7be05f3243f8ecd65d798", "type": "github" }, "original": { @@ -36,10 +57,28 @@ }, "root": { "inputs": { + "fenix": "fenix", "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1737875522, + "narHash": "sha256-PkT88NCsweL62NiWhpcv3wvR8DmgE6stIH6h5qemrzs=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "2df4ecfc74bbadf1281e13d73f8424f7b5c1514b", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index d6ba1fd..f86a861 100644 --- a/flake.nix +++ b/flake.nix @@ -1,13 +1,20 @@ { inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; + flake-utils.url = "github:numtide/flake-utils"; + + fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { self, nixpkgs, flake-utils, + fenix, }: flake-utils.lib.eachDefaultSystem ( system: let @@ -15,9 +22,15 @@ inherit system; }; + toolchain = fenix.packages.${system}.toolchainOf { + channel = "1.84"; + date = "2025-01-09"; + sha256 = "lMLAupxng4Fd9F1oDw8gx+qA0RuF7ou7xhNU8wgs0PU="; + }; + rustPlatform = pkgs.makeRustPlatform { - cargo = pkgs.cargo; - rustc = pkgs.rustc; + cargo = toolchain.cargo; + rustc = toolchain.rustc; }; cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml); @@ -36,18 +49,12 @@ packages = with pkgs; [ # Rust toolchain - cargo - rustc - - # Code analysis tools - clippy - rust-analyzer + toolchain.toolchain # Code formatting tools treefmt alejandra mdl - rustfmt # Rust dependency linting cargo-deny