diff --git a/flake.lock b/flake.lock index 53b6b67..61563dc 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "fenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1761806629, + "narHash": "sha256-3u8345VliQtbpOtCNYYpDTCsjS8A9osrpU03E8TaIBw=", + "owner": "nix-community", + "repo": "fenix", + "rev": "c7c690951af16e60912678fab6155fb120cc27b0", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1758690382, @@ -18,8 +39,26 @@ }, "root": { "inputs": { + "fenix": "fenix", "nixpkgs": "nixpkgs" } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1761739801, + "narHash": "sha256-ONUpb+l5oEIb9iOGkmUhze5YjRexZ6sc3mwQyLXlcms=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "769ebafdc66559d620bdc414743f32bb28180c58", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index d41ae7e..f8aa379 100644 --- a/flake.nix +++ b/flake.nix @@ -1,12 +1,30 @@ { inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + + fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = - { self, nixpkgs }: + { + self, + nixpkgs, + fenix, + }: let pkgs = nixpkgs.legacyPackages.x86_64-linux; + rustPkgs = fenix.packages.x86_64-linux.default; + + rustPlatform = pkgs.makeRustPlatform { + inherit (rustPkgs) + cargo + rustc + ; + }; + nativeBuildInputs = with pkgs; [ pkg-config m4 @@ -29,7 +47,7 @@ }; devShells.x86_64-linux.default = mkShell { - packages = [ + packages = with rustPkgs; [ cargo clippy rustc