-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: attribute 'lib' missing, at /nix/store/gqargdzl2sbxsw8sxfzpmicxalpqr4s3-source/rust-overlay.nix:315:30 #733
Comments
Thanks for flagging! Recently I've been experimenting with using the following let
nixpkgs = import <nixpkgs> {};
rtc = (nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain);
rust = rtc.override {
extensions = [ "rust-src" "rust-analysis" ];
};
in
with nixpkgs;
mkShell {
name = "rust";
buildInputs = [
cargo-deny
cargo-expand
cargo-watch
openssl
pkgconfig
ripgrep
rust
];
} Using |
I'm getting
on my machine. This OTOH works for me: let
mozilla_overlay = import (builtins.fetchTarball {
# url = "https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz";
url = "https://github.com/mozilla/andersk/archive/3499e085fb6ae1a846bcf425fa9c98a3b77480da.tar.gz";
sha256 = "1fd9n6p8vjlb5vqka2fzxrf1xb7lif5ibjvx8h1fk5w3yqkds2lg";
});
nixpkgs = import <nixpkgs> { overlays = [ mozilla_overlay ]; };
myrust = ((nixpkgs.rustChannelOf { rustToolchain = ./rust-toolchain; }).rust.override { extensions = [ "rust-src" "rust-analysis" "rustfmt-preview" ];});
in
with nixpkgs;
mkShell {
buildInputs = [
# to use the latest nightly:
# nixpkgs.latest.rustChannels.nightly.rust
# to use a specific nighly:
# (nixpkgs.rustChannelOf { date = "2018-04-11"; channel = "nightly"; }).rust
# to use the project's rust-toolchain file:
# (nixpkgs.rustChannelOf { rustToolchain = ./rust-toolchain; }).rust
myrust
cargo-deny
cargo-expand
cargo-watch
openssl
pkgconfig
ripgrep
];
} Note that it pins the overlay to a specific version to avoid some "spontaneous" breakages. |
Somewhat related: Is it even needed to run rustc nightly instead of stable? Is there some feature not available on stable that's being used? |
You likely need to add [ (import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz")) ] If you already have that file, then you should just be able to add it to your list of overlays. |
Easily checked by changing the toolchain to
I think there may be others, so yes we're relying on nightly for the time being :) |
Hmm, from a point of view of someone completely new to the project, that's an additional step that needs to be performed. It can be avoided by specifying the overlay config within |
For me, it's easier and is one of the recommended ways here: https://github.com/oxalica/rust-overlay#use-as-a-classic-nix-overlay. But if you have a better setup then I'd be willing to look over a PR and try it out :) My Nix-fu isn't the best, so I use what I can to get by 😄 |
Same here, Sir 😄 Looks like oxalica's overlay claims to improve upon Mozilla's. I have only used Mozilla's so far so would have to play with it first to make my mind about it :) |
Ahaha very good 😄 Welcome to the club! I used Mozilla's for a while but then it started breaking a lot for me so I abandoned it for |
There's a build issue on latest NixOS (21.05):
It's caused by the Mozilla Rust overlay using deprecated nixpkgs "API": mozilla/nixpkgs-mozilla#250
Until the upstream Mozilla overlay PR gets merged, a workaround can be used:
The text was updated successfully, but these errors were encountered: