parameterize the rustManifest file

This commit is contained in:
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
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 ]; },
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) {};

View File

@ -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 =

View File

@ -1,8 +1,13 @@
# 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 {
inherit rustManifest;
mozillaOverlay = import <mozillaOverlay>;
rustRestrictedManifest = true;
});