Open EmJee13 opened 3 years ago
Another instance of this can be observed when trying to build nushell
:
git clone https://github.com/nushell/nushell.git
cd nushell
# the current release while I'm writing this
git checkout 0.28.0
nix-env -i -f https://github.com/kolloch/crate2nix/tarball/0.9.0
crate2nix generate
nix-env -iA nixos.niv
niv init
niv add mozilla/nixpkgs-mozilla
# Copied from crate2nix's manual
cat << 'EOF' >> nix/nixpkgs.nix
let
# Manage this with https://github.com/nmattia/niv
# or define { nixpkgs = ...; nixpkgs-mozilla = ...; }
# yourself.
sources = import ./sources.nix;
rustChannelsOverlay = import "${sources.nixpkgs-mozilla}/rust-overlay.nix";
# Useful if you also want to provide that in a nix-shell since some rust tools depend
# on that.
rustChannelsSrcOverlay = import "${sources.nixpkgs-mozilla}/rust-src-overlay.nix";
in import sources.nixpkgs {
overlays = [
rustChannelsOverlay
rustChannelsSrcOverlay
(self: super: {
# Replace "latest.rustChannels.stable" with the version of the rust tools that
# you would like. Look at the documentation of nixpkgs-mozilla for examples.
#
# NOTE: "rust" instead of "rustc" is not a typo: It will include more than needed
# but also the much needed "rust-std".
rustc = super.latest.rustChannels.stable.rust;
inherit (super.latest.rustChannels.stable) cargo rust rust-fmt rust-std clippy;
})
];
}
EOF
cat << 'EOF' >> default.nix
{ pkgs ? import ./nix/nixpkgs.nix }:
let cargoNix = pkgs.callPackage ./Cargo.nix {};
in cargoNix.workspaceMembers.nu
EOF
nix-build
Yields
trace: warning: `buildRustCrate` is deprecated, use `buildRustCrateForPkgs` instead
error: value is a list while a string was expected, at /nix/store/37ps73gpjhkbd02w5cyynqscskkvl5hm-nixpkgs-src/pkgs/build-support/rust/build-rust-crate/default.nix:23:13
(use '--show-trace' to show detailed location information)
I tried to use crate2nix along the "Choosing a Rust Version" readme part. My sample code had only one dependency, copypasta (version = "0.7"). Running nix-build returns the following error:
The whole trace looks like this: