[BUG] nix flake requires having rust-overlay installed separately
Checklist before submitting an issue
- [X] I have searched through the existing closed and open issues for eww and made sure this is not a duplicate
- [X] I have specifically verified that this bug is not a common user error
- [X] I am providing as much relevant information as I am able to in this bug report (Minimal config to reproduce the issue for example, if applicable)
Description of the bug
When building from the nix flake, I get an error if I do not have the rust-overlay flake installed even thought it is declared as a dependency in eww's flake.
Reproducing the issue
- Using a flake-based NixOS setup, add eww's flake, add its overlay, either enable eww in home manager or install its package, and run
nixos-rebuild test. This should fail with an error from nix sayingerror: attribute 'rust-bin' missing - Add rust-overlay as a flake input, add its overlay, and run
nixos-rebuild testagain. Eww should build and install successfully.
Expected behaviour
I expected to not need to manually set up rust-overlay for eww to successfully build.
Additional context
error:
… while calling the 'head' builtin
at /nix/store/vby8c3909sglr03fxkclkly29vs49ncy-source/lib/attrsets.nix:784:11:
783| || pred here (elemAt values 1) (head values) then
784| head values
| ^
785| else
… while evaluating the attribute 'value'
at /nix/store/vby8c3909sglr03fxkclkly29vs49ncy-source/lib/modules.nix:759:9:
758| in warnDeprecation opt //
759| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
760| inherit (res.defsFinal') highestPrio;
(stack trace truncated; use '--show-trace' to show the full trace)
error: attribute 'rust-bin' missing
at /nix/store/a0h8yw7sjr5i75x5s0s3jj1lkz15h1xb-source/flake.nix:21:31:
20| targetSystems = [ "aarch64-linux" "x86_64-linux" ];
21| mkRustToolchain = pkgs: pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
| ^
22| in
Not sure if it's related but the version of rust-overlay that eww is using has known issues with newer versions of nixpkgs. See https://github.com/oxalica/rust-overlay/issues/121 . Fixed by bump the version in #818
If you're using a nix flake you can avoid the issue temporarily with:
{
inputs = {
eww.url = "github:elkowar/eww";
eww.inputs.nixpkgs.follows = "nixpkgs";
eww.inputs.rust-overlay.follows = "rust-overlay";
// ...
};
// ...
}
Hey @PatrickShaw!
I've tried doing what you suggested but am still getting errors like
> error[E0599]: no method named `drain_filter` found for struct `std::collections::HashMap` in the current scope
> --> crates/eww/src/widgets/widget_definitions.rs:130:62
> |
> 130 | let contained_deprecated: Vec<_> = bargs.unhandled_attrs.drain_filter(|a, _| deprecated.contains(&a.0 as &str)).collect();
> | ^^^^^^^^^^^^ method not found in `HashMap<AttrName, AttrEntry>`
when compiling eww-wayland. Seems like the rust version used for eww-wayland build is still not up do date. These are my inputs:
nixpkgs.url = "github:NixOs/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
eww-wayland.url = "github:elkowar/eww";
# tmp fix https://github.com/elkowar/eww/issues/817
eww-wayland.inputs.nixpkgs.follows = "nixpkgs";
eww-wayland.inputs.rust-overlay.follows = "rust-overlay";
any idea what's going on here? :thinking: