From ec48de56ac025f98c2a16f22784bbc5e50d6e79a Mon Sep 17 00:00:00 2001 From: Edward Amsden Date: Thu, 23 Feb 2023 18:03:30 -0600 Subject: [PATCH] [ares] use fenix to get rust for nix shell --- rust/nix/sources.json | 12 ++++++++++++ rust/shell.nix | 16 ++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/rust/nix/sources.json b/rust/nix/sources.json index 05259e1..eee0f7f 100644 --- a/rust/nix/sources.json +++ b/rust/nix/sources.json @@ -1,4 +1,16 @@ { + "fenix": { + "branch": "main", + "description": "Rust toolchains and rust-analyzer nightly for Nix [maintainer=@figsoda]", + "homepage": "", + "owner": "nix-community", + "repo": "fenix", + "rev": "b2795124606227326e336062f7d2240446c9ae2b", + "sha256": "0x77p2q4w58bmfvpxxks46vbi3zl8142mjqy7xap7nr1a06a262h", + "type": "tarball", + "url": "https://github.com/nix-community/fenix/archive/b2795124606227326e336062f7d2240446c9ae2b.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, "nixpkgs": { "branch": "nixos-22.11", "description": "Nix Packages collection", diff --git a/rust/shell.nix b/rust/shell.nix index 556ee49..821ba53 100644 --- a/rust/shell.nix +++ b/rust/shell.nix @@ -1,4 +1,16 @@ -{ sources ? import ./nix/sources.nix, pkgs ? import sources.nixpkgs {} }: +{ sources ? import ./nix/sources.nix, + pkgs ? import sources.nixpkgs { + overlays = [ (import "${sources.fenix}/overlay.nix") ]; + } +}: pkgs.mkShell { - packages = with pkgs; [ rustc cargo cargo-watch rustfmt ]; + packages = with pkgs; [ + (fenix.stable.withComponents [ + "cargo" + "rustc" + "rustfmt" + "rust-src" + ]) + cargo-watch + ]; }