From f0202c96d9607de686d02d6868f7a3a79c2a30fe Mon Sep 17 00:00:00 2001 From: derped Date: Fri, 12 Jun 2020 08:41:24 +0200 Subject: [PATCH] pkgsets/rust: Fix rust overlay. --- pkgsets/rustpkgs.nix | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/pkgsets/rustpkgs.nix b/pkgsets/rustpkgs.nix index 8e45816..85db920 100644 --- a/pkgsets/rustpkgs.nix +++ b/pkgsets/rustpkgs.nix @@ -1,13 +1,39 @@ -{ config, pkgs, ... }: +{ config, ... }: let - stablepkgs = import {}; + mozRust = with builtins; (map (p: import ((fetchTarball { + url = "https://github.com/mozilla/nixpkgs-mozilla/archive/e912ed4.tar.gz"; + sha256 = "08fvzb8w80bkkabc1iyhzd15f4sm7ra10jn32kfch5klgl0gj3j3"; + }) + p))) [ + (toPath "/lib-overlay.nix") + (toPath "/rust-overlay.nix") + ]; + stablepkgs = import { overlays = mozRust;}; + + # https://rust-lang.github.io/rustup-components-history + nightly = stablepkgs.rustChannelOf { + date = "2020-06-10"; + channel = "nightly"; + }; + rustNightly = { + rustc = nightly.rust.override { + extensions = [ + "clippy-preview" + "rls-preview" + "rust-analysis" + "rust-src" + "rustfmt-preview" + ]; } // { src = nightly.rust-src; }; + cargo = nightly.cargo; + }; + rustPNightly = stablepkgs.recurseIntoAttrs (stablepkgs.makeRustPlatform { + inherit (rustNightly) rustc cargo; + }); + in { - config.machine.pkgsets.rustpkgs.pkgs = with stablepkgs; [ + config.machine.pkgsets.rustpkgs.pkgs = (with stablepkgs; [ diesel-cli - rustup - rls carnix rustracer - ]; + ]) ++ (with rustNightly; [ rustc cargo]); }