Skip to content

Instantly share code, notes, and snippets.

@tilpner
Created February 2, 2019 13:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tilpner/0a781a87fcff1f83cf08ce91e38dade0 to your computer and use it in GitHub Desktop.
Save tilpner/0a781a87fcff1f83cf08ce91e38dade0 to your computer and use it in GitHub Desktop.
with import <nixpkgs> {};
let
inherit (nur.repos.mozilla.rustChannels.nightly) rust;
buildRustCrateWithFlags = flags: args: (buildRustCrate.override {
rustc = rust;
}) (args // {
extraRustcOpts = (args.extraRustcOpts or []) ++ flags;
});
callCarnix = p: flags:
let
callPackage = newScope {
buildRustCrate = buildRustCrateWithFlags flags;
};
in
callPackage (p + "/Cargo.nix") {
cratesIO = callPackage (p + "/crates-io.nix") {};
};
in (callCarnix ./. [ "--edition 2018" ]).sd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment