From c6d6f558b0b36a7e1cd526aee95f9e5fa666aa2d Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Sun, 18 Jun 2023 18:09:50 -0400 Subject: [PATCH] pkgs(rust): install using rust-overlay --- flake.lock | 71 +++++++++++++++++++++++++++++++++++++++++++- flake.nix | 4 ++- user/modules/dev.nix | 6 ++-- 3 files changed, 76 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 0df31d6..5502d87 100644 --- a/flake.lock +++ b/flake.lock @@ -55,6 +55,24 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -113,6 +131,22 @@ "type": "indirect" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1681358109, + "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nur": { "locked": { "lastModified": 1687102100, @@ -135,10 +169,30 @@ "nixos-wsl": "nixos-wsl", "nixpkgs": "nixpkgs", "nur": "nur", + "rust-overlay": "rust-overlay", "unstable": "unstable", "utils": "utils" } }, + "rust-overlay": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1687055571, + "narHash": "sha256-UvLoO6u5n9TzY80BpM4DaacxvyJl7u9mm9CA72d309g=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "2de557c780dcb127128ae987fca9d6c2b0d7dc0f", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, @@ -169,6 +223,21 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "unstable": { "locked": { "lastModified": 1686960236, @@ -186,7 +255,7 @@ }, "utils": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1685518550, diff --git a/flake.nix b/flake.nix index 0e973c1..0bb7d43 100644 --- a/flake.nix +++ b/flake.nix @@ -7,6 +7,7 @@ nur.url = "github:nix-community/NUR"; utils.url = "github:numtide/flake-utils"; + rust-overlay.url = "github:oxalica/rust-overlay"; nixos-wsl = { url = "github:nix-community/NixOS-WSL"; @@ -28,7 +29,7 @@ }; }; - outputs = { self, nixpkgs, unstable, nur, utils, nixos-wsl, darwin, home-manager, ... }@inputs: { + outputs = { self, nixpkgs, unstable, nur, utils, rust-overlay, nixos-wsl, darwin, home-manager, ... }@inputs: { # This repo's overlay plus any other overlays you use # If you want to use packages from flakes that are not nixpkgs (such as NUR), add their overlays here.\ @@ -40,6 +41,7 @@ trunk = import inputs.trunk { system = final.system; }; } ); + rust-overlay = rust-overlay.overlays.default; }; overlaysModule = { diff --git a/user/modules/dev.nix b/user/modules/dev.nix index 623df9b..6acfe38 100644 --- a/user/modules/dev.nix +++ b/user/modules/dev.nix @@ -19,8 +19,8 @@ rnix-lsp nixpkgs-fmt # Rust - cargo - rustc - rustfmt + (rust-bin.stable.latest.default.override { + extensions = [ "rust-src" ]; + }) ]; }