From bd42bc91293362a7da83ccef86e2d910167d4ac7 Mon Sep 17 00:00:00 2001 From: Astro Date: Tue, 19 Mar 2019 22:12:28 +0100 Subject: [PATCH] parameterize the rustManifest file --- default.nix | 9 ++------- nix/rustPlatform.nix | 4 ++-- release.nix | 7 ++++++- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/default.nix b/default.nix index def86d6..1bbdc53 100644 --- a/default.nix +++ b/default.nix @@ -1,18 +1,13 @@ { # Use master branch of the overlay by default mozillaOverlay ? import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz), - # This is needed when nix-build is run with option - # `restrict-eval`. Setting this flag to `true` causes the - # rustPlatform to be generated from the bundled - # `channel-rust-nightly.toml`. By default (`false`) the - # mozillaOverlay fetches the latest manifest. - rustRestrictedManifest ? false, pkgs ? import { overlays = [ mozillaOverlay ]; }, + rustManifest ? builtins.fetchurl "https://static.rust-lang.org/dist/channel-rust-nightly.toml" }: with pkgs; let rustPlatform = recurseIntoAttrs (callPackage (import ./nix/rustPlatform.nix) { - restrictedManifest = rustRestrictedManifest; + inherit rustManifest; }); adc2tcp = callPackage (import ./nix/adc2tcp.nix) { inherit rustPlatform; }; openocd = callPackage (import ./nix/openocd.nix) {}; diff --git a/nix/rustPlatform.nix b/nix/rustPlatform.nix index 9758dba..4a9c8a2 100644 --- a/nix/rustPlatform.nix +++ b/nix/rustPlatform.nix @@ -1,7 +1,7 @@ { recurseIntoAttrs, stdenv, lib, makeRustPlatform, rustChannelOfTargets, fetchurl, patchelf, - restrictedManifest ? false + rustManifest ? ./channel-rust-nightly.toml }: let @@ -13,7 +13,7 @@ let "thumbv7em-none-eabihf" ]; rustChannel = - lib.rustLib.fromManifestFile ./channel-rust-nightly.toml { + lib.rustLib.fromManifestFile rustManifest { inherit stdenv fetchurl patchelf; }; rust = diff --git a/release.nix b/release.nix index 624f6fc..7f31c3d 100644 --- a/release.nix +++ b/release.nix @@ -1,8 +1,13 @@ # For running on Hydra -{ pkgs ? import {}}: +{ pkgs ? import {}, + rustManifest ? ./nix/channel-rust-nightly.toml +}: { +channel = pkgs.releaseTools.channel { + name = "adc2tcp"; adc2tcp = pkgs.lib.hydraJob (import ./default.nix { + inherit rustManifest; mozillaOverlay = import ; rustRestrictedManifest = true; });