nix: bundle a rust nightly channel manifest for Hydra restrict-eval being always-on

This commit is contained in:
Astro 2019-03-19 21:18:26 +01:00
parent 3af1f72e7d
commit b385e96bc8
4 changed files with 11177 additions and 8 deletions

View File

@ -1,10 +1,19 @@
let
mozillaOverlay = import <mozillaOverlay>;
pkgs = import <nixpkgs> { overlays = [ mozillaOverlay ]; };
in
{ # 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 ]; },
}:
with pkgs;
let
rustPlatform = recurseIntoAttrs (callPackage (import ./nix/rustPlatform.nix) {});
rustPlatform = recurseIntoAttrs (callPackage (import ./nix/rustPlatform.nix) {
restrictedManifest = rustRestrictedManifest;
});
adc2tcp = callPackage (import ./nix/adc2tcp.nix) { inherit rustPlatform; };
openocd = callPackage (import ./nix/openocd.nix) {};
in

11141
nix/channel-rust-nightly.toml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,27 @@
{ recurseIntoAttrs, makeRustPlatform, rustChannelOfTargets, rustChannel ? "nightly" }:
{ recurseIntoAttrs, stdenv, lib,
makeRustPlatform, rustChannelOfTargets,
fetchurl, patchelf,
restrictedManifest ? false
}:
let
targets = [
# "x86_64-unknown-linux-gnu"
# "thumbv6m-none-eabi"
# "thumbv7m-none-eabi"
# "thumbv7em-none-eabi"
"thumbv7em-none-eabihf"
];
rust = builtins.trace "rustChannel: selected channel ${rustChannel}"
rustChannelOfTargets rustChannel null targets;
rustChannel =
lib.rustLib.fromManifestFile ./channel-rust-nightly.toml {
inherit stdenv fetchurl patchelf;
};
rust =
if restrictedManifest
then
rustChannel.rust.override { inherit targets; }
else
rustChannelOfTargets "nightly" null targets;
in
makeRustPlatform {
rustc = rust;

6
release.nix Normal file
View File

@ -0,0 +1,6 @@
# For running on Hydra
import ./default.nix {
mozillaOverlay = import <mozillaOverlay>;
rustRestrictedManifest = true;
}