Skip to content

Instantly share code, notes, and snippets.

@dysinger
Created February 6, 2020 20:46
Show Gist options
  • Save dysinger/01e8aa169e2e5879199eee7b9c59b7e4 to your computer and use it in GitHub Desktop.
Save dysinger/01e8aa169e2e5879199eee7b9c59b7e4 to your computer and use it in GitHub Desktop.
{ cargo
, makeRustPlatform
, rustChannelOf
, rustc
, sources
, targetPlatform
}:
rec {
rustNightly =
let
modifyTarget = x:
if builtins.isList x
then builtins.map modifyTarget x
else
if builtins.isString x
then builtins.replaceStrings ["armv7l"] ["armv7"] x
else x;
version = "1.39.0-nightly-2020-01-01";
src = sources.rust;
rust = {
rustc = rustc.overrideAttrs (orig: {
inherit version src;
configureFlags = modifyTarget orig.configureFlags;
});
cargo = cargo.overrideAttrs (_: { inherit version src; });
};
in {
inherit (rust) cargo rustc;
rustPlatform = makeRustPlatform { inherit (rust) cargo rustc; };
};
rustNightlyMozilla =
let
rust = rustChannelOf { channel = "nightly"; date = "2020-01-01"; };
in {
rustPlatform = makeRustPlatform { inherit (rust) cargo rustc; };
inherit (rust) cargo rustc;
};
rustStable = {
inherit cargo rustc;
rustPlatform = makeRustPlatform { inherit cargo rustc; };
};
rustStableMozilla =
let
rust = rustChannelOf { channel = "stable"; };
in {
inherit (rust) cargo rustc;
rustPlatform = makeRustPlatform { inherit (rust) cargo rustc; };
};
rage = rustStable.rustPlatform.buildRustPackage rec {
name = "rage-${version}";
version = "0.1.1";
src = sources.rage;
cargoSha256 = "0zj01n1dv59s7rvlwfx80idqbgm5ilfmzf2wi7xnnwmbwiig5hk4";
verifyCargoDeps = true;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment