parameterize the rustManifest file

softspi
Astro 2019-03-19 22:12:28 +01:00
parent 6466a8deeb
commit bd42bc9129
3 changed files with 10 additions and 10 deletions

View File

@ -1,18 +1,13 @@
{ # Use master branch of the overlay by default { # Use master branch of the overlay by default
mozillaOverlay ? import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz), 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 <nixpkgs> { overlays = [ mozillaOverlay ]; }, pkgs ? import <nixpkgs> { overlays = [ mozillaOverlay ]; },
rustManifest ? builtins.fetchurl "https://static.rust-lang.org/dist/channel-rust-nightly.toml"
}: }:
with pkgs; with pkgs;
let let
rustPlatform = recurseIntoAttrs (callPackage (import ./nix/rustPlatform.nix) { rustPlatform = recurseIntoAttrs (callPackage (import ./nix/rustPlatform.nix) {
restrictedManifest = rustRestrictedManifest; inherit rustManifest;
}); });
adc2tcp = callPackage (import ./nix/adc2tcp.nix) { inherit rustPlatform; }; adc2tcp = callPackage (import ./nix/adc2tcp.nix) { inherit rustPlatform; };
openocd = callPackage (import ./nix/openocd.nix) {}; openocd = callPackage (import ./nix/openocd.nix) {};

View File

@ -1,7 +1,7 @@
{ recurseIntoAttrs, stdenv, lib, { recurseIntoAttrs, stdenv, lib,
makeRustPlatform, rustChannelOfTargets, makeRustPlatform, rustChannelOfTargets,
fetchurl, patchelf, fetchurl, patchelf,
restrictedManifest ? false rustManifest ? ./channel-rust-nightly.toml
}: }:
let let
@ -13,7 +13,7 @@ let
"thumbv7em-none-eabihf" "thumbv7em-none-eabihf"
]; ];
rustChannel = rustChannel =
lib.rustLib.fromManifestFile ./channel-rust-nightly.toml { lib.rustLib.fromManifestFile rustManifest {
inherit stdenv fetchurl patchelf; inherit stdenv fetchurl patchelf;
}; };
rust = rust =

View File

@ -1,8 +1,13 @@
# For running on Hydra # For running on Hydra
{ pkgs ? import <nixpkgs> {}}: { pkgs ? import <nixpkgs> {},
rustManifest ? ./nix/channel-rust-nightly.toml
}:
{ {
channel = pkgs.releaseTools.channel {
name = "adc2tcp";
adc2tcp = pkgs.lib.hydraJob (import ./default.nix { adc2tcp = pkgs.lib.hydraJob (import ./default.nix {
inherit rustManifest;
mozillaOverlay = import <mozillaOverlay>; mozillaOverlay = import <mozillaOverlay>;
rustRestrictedManifest = true; rustRestrictedManifest = true;
}); });