diff --git a/flake.lock b/flake.lock index fc4aa04..42d7fdc 100644 --- a/flake.lock +++ b/flake.lock @@ -37,7 +37,31 @@ "root": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1702088052, + "narHash": "sha256-FkwIBTAMsxyceQce0Mbm+/+cOjj2r5IHBK4R/ekPNaw=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "2cfb76b8e836a26efecd9f853bea78355a11c58a", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" } }, "systems": { diff --git a/flake.nix b/flake.nix index ad365b3..c82f5b8 100644 --- a/flake.nix +++ b/flake.nix @@ -4,12 +4,20 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-utils.follows = "flake-utils"; + }; + }; }; - outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: + outputs = { self, nixpkgs, flake-utils, rust-overlay }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; + overlays = [ rust-overlay.overlays.default ]; }; in { diff --git a/shells/rust.nix b/shells/rust.nix index ec3af8b..e1b7c97 100644 --- a/shells/rust.nix +++ b/shells/rust.nix @@ -1,5 +1,7 @@ { pkgs }: pkgs.mkShell { - packages = with pkgs; [ cargo rustc rustfmt rust-analyzer ]; + buildInputs = with pkgs; [ + (rust-bin.stable.latest.default.override { extensions = [ "rust-src" "rust-analyzer" ]; }) + ]; shellHook = '' export CARGO_HOME=$PWD/.nix/cargo export PATH=$CARGO_HOME/bin:$PATH