elkowar / eww

ElKowars wacky widgets

Home Page:https://elkowar.github.io/eww

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Nix Flake wayland output is still broken

w-lfchen opened this issue · comments

Checklist before submitting an issue

  • I have searched through the existing closed and open issues for eww and made sure this is not a duplicate
  • I have specifically verified that this bug is not a common user error
  • 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

The eww and eww-wayland package outputs of the nix flake are currently broken on wayland.
This should have been fixed by #1032, but I overlooked something, I would like to apologize for my mistake there.
There are a few ways to resolve this, but I believe that I lack the experience to judge how this should be done.

  1. Wait until NixOS/nixpkgs#289595 is merged and makes it into nixpkgs-unstable, then simply update the flake.lock file
  2. This can be done right now: Revert this line to
    eww-wayland = final.eww.override { withWayland = true; };, this will work temporarily until the aforementioned pr is merged and the lockfile is updated, then the eww-wayland output will no longer evaluate.
  3. Change the options that cargo builds with. I'm sure that this is possible, but it can't simply be done by changing the overlay as far as I'm concerned and due to exams I currently don't have the time to look into this further. It would also be no longer needed once the pr is merged and the lockfile is updated.

Reproducing the issue

Run nix build or nix build .#eww-wayland, nix will instruct cargo to build with the flags --no-default-features --features=x11, as specified here.

Expected behaviour

Cargo should build with default features.

Additional context

Once again, I am deeply sorry for overlooking this, I think it would be best to wait for the merge and then simply update the lockfile. My belief that this works is based on changing the nixpkgs url to "github:coffee-is-power/nixpkgs/patch-1", which results in a correctly functioning binary.
Anything that resolves this issue should also result in #733, #775 and #817 being resolved.

On a different note, I believe that the current flake structure isn't that good due to the heavy reliance on nixpkgs, which is also why it's currently half broken. I admittedly don't know whether this is standard practice or not, I think it'd be a better idea to use the package in the overlay, not the other way around, but I can't rule out that I have made yet another mistake in understanding the inner works of all of this.

Temporary fix

Update: Use the pr as it should now be ready for a merge and is therefore in a usable state
Use this branch from #1038 until the pr is merged:

{
  # url = "github:elkowar/eww";
  inputs.nixpkgs.follows = "nixpkgs";
  # use this until https://github.com/elkowar/eww/issues/1038 is merged
  url = "github:w-lfchen/eww/flake";
};

It shouldn't matter whether you override nixpkgs or not, please tell me if it does matter as this is not expected behavior.

Sadly even with your branch I seem to get

eww > Eww compiled without wayland support. falling back to X11, eventhough wayland was requested.
failed to open window `bar`

Caused by:
    Failed to get x11 window for gtk window

Maybe you can consider using https://github.com/nix-community/naersk instead of rust-overlay
For now I reverted to d96586c where the flake still works

For now I reverted to d96586c where the flake still works

It was broken on that commit. @Cloudef Can I get some context from you, especially in regards to how you're importing and using the flake and whether you are changing the nixpkgs input?

I'm currently looking into rewriting the flake as the currently structure is suboptimal and can easily break.
Thank you for the recommendation, I'll consider it, though from a quick glance I'm not sure whether naersk supports rust 1.76.0 which is required and the reason for using the overlay as far as I'm concerned.

My flakes are here:
https://github.com/Cloudef/nixos-flake/blob/master/flake.nix#L4-L26
https://github.com/Cloudef/nixos-flake/blob/master/modules/eww.nix

I realized, that the reason why it broke for me, but earlier commit works for me is that because I also actually override rust overlay there, probably to workaround whatever you have been fixing 😓
https://github.com/Cloudef/nixos-flake/blob/master/modules/eww.nix#L44C7-L44C43

This line is breaking it or will break in the future. It changes the nixpkgs input of the flake to be in line with the main one your flake depends on. If you remove it, my fork should work just fine.
This breaks my fork as all it does is change this nixpkgs input, which admittedly is a bit suboptimal as it results in you downloading nixpkgs at least twice but it is the easiest solution for the time being, I'll update the fix to point out that overriding the input is something you shouldn't do.
If you leave it in its current state, it could break once pr 289595 makes it into nixos-unstable and you update your lockfile due to the old flake then calling the eww-wayland output with an argument that no longer exists.

@Cloudef You might want to check out my updated temporary fix, I'd appreciate it if you could comment under the pr whether it works for you (hopefully it does ^^')

If you remove it, my fork should work just fine.

Actually I did remove it but it did not work, so that's why I think it might be rust-overlay that eventually breaks it (and that also has nixpkgs follow)

How does rust overlay break it and does that apply to the current fix as well?

Lemme try, as I just removed it and did not try with it with your recent changes.

It works even with rust-overlay in inputs and override now as well.

Thank you for testing that, if I'm not mistaken it should work as long as the overlay is able to provide rust 1.76.0 since that is what eww needs