From 7a28cb1cd474fea05adc5135af6f69f83e439d96 Mon Sep 17 00:00:00 2001 From: Astro Date: Sun, 13 Dec 2020 20:42:29 +0100 Subject: [PATCH] shell.nix: use rustPlaform from by default Fixes Gitea issue #25 --- shell.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/shell.nix b/shell.nix index fe3e878..04bf3e6 100644 --- a/shell.nix +++ b/shell.nix @@ -1,10 +1,16 @@ -{ mozillaOverlay ? builtins.fetchTarball "https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz" +{ mozillaOverlay ? builtins.fetchTarball "https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz", + latestRustNightly ? false, }: let pkgs = import { overlays = [ (import mozillaOverlay) ]; }; - rust = pkgs.rustChannelOfTargets "nightly" null [ "thumbv7em-none-eabihf" ]; + rust = + if latestRustNightly + then pkgs.rustChannelOfTargets "nightly" null [ "thumbv7em-none-eabihf" ] + else (pkgs.recurseIntoAttrs ( + pkgs.callPackage (import ) {} + )).rust.cargo; in pkgs.mkShell { name = "thermostat-env";