eww icon indicating copy to clipboard operation
eww copied to clipboard

Updated nix overlay to support wayland and X11 at the same time (and remove eww-wayland overlay)

Open Philipp-M opened this issue 1 year ago • 12 comments

Description

Fixes #733

Since X11 and wayland is now supported at the same time, eww could be reduced to the same package eww. Right now this builds with support for X11 and wayland (default features). It may make sense to add more fine-grained support for different features in upstream via parameters, when it is updated there (i.e. withWayland, withX11, for either X11 or wayland support or both at the same time (should probably be the default then)) .

Philipp-M avatar Apr 17 '23 15:04 Philipp-M

As of 82e13c18d3bbba3ab9a2bff8096a2ae98b030b35, it builds only with wayland feature so it opens as a regular window on x11.

adomixaszvers avatar Apr 17 '23 16:04 adomixaszvers

Ah, yeah the common pitfalls of overwriting constructor functions (in this case buildRustPackage), I think now it should do the right thing.

Philipp-M avatar Apr 17 '23 17:04 Philipp-M

It does not build with x11 feature.

$ nix build --no-link 'github:Philipp-M/eww/df6bed4d6aee994dac231a787b11fde900a2c486#eww'

$ nix log 'github:Philipp-M/eww/df6bed4d6aee994dac231a787b11fde900a2c486#eww' 

Cargo invokation was

env CC_x86_64-unknown-linux-gnu=/nix/store/3d9zjv5vaqjxb9kwbdqsd194alwm97x1-gcc-wrapper-11.3.0/bin/cc CXX_x86_64-unknown-linux-gnu=/nix/store/3d9zjv5vaqjxb9kwbdqsd194alwm97x1-gcc-wrapper-11.3.0/bin/c++ CC_x86_64-unknown-linux-gnu=/nix/store/3d9zjv5vaqjxb9kwbdqsd194alwm97x1-gcc-wrapper-11.3.0/bin/cc CXX_x86_64-unknown-linux-gnu=/nix/store/3d9zjv5vaqjxb9kwbdqsd194alwm97x1-gcc-wrapper-11.3.0/bin/c++ cargo build -j 8 --target x86_64-unknown-linux-gnu --frozen --release --features=wayland --bin eww

adomixaszvers avatar Apr 18 '23 08:04 adomixaszvers

Are you sure, that it's not having the x11 feature? AFAIK features are additive as long as default features aren't explicitly disabled. So this should be equivalent to just (roughly) cargo build.

Philipp-M avatar Apr 18 '23 11:04 Philipp-M

Oh, I didn't see you've enabled the default features. It seems fine. image

I could close my PR #734 but what about the comment https://github.com/elkowar/eww/pull/734#issuecomment-1506478834 ?

adomixaszvers avatar Apr 18 '23 12:04 adomixaszvers

As mentioned before, I would do these things/changes in the nixpkgs repo (add supportWayland and supportX11 to the derivation inputs of eww and set them to true by default, I don't think the extra dependency really hurts in X11 unless it really changes the behavior of eww. I think it's better to just support everything by default to avoid headaches.

So if a user really only wants X11 or wayland, the user has to explicitly disable the other features (i.e. stay close to the default features of eww).

I would update these things in nixpkgs when the next release of eww happens.

Philipp-M avatar Apr 18 '23 12:04 Philipp-M

Was this tested (runtime)? I imagine #739 would cause problems and this change maybe doesn't make sense to merge as is (right now)

fwiw turning off default features and building with wayland does work regardless

eclairevoyant avatar May 23 '23 06:05 eclairevoyant

You're correct just tested it in hyprland, seems like I forgot to test this properly with wayland, #739 seems to be an issue. Well than the question arises, if #739 should be fixed first, or I'm handling the cases differently (i.e. disable the x11 feature for wayland support). I believe fixing #739 would be better to be able to use one binary for all backends.

I think it makes sense to offer multiple flake outputs (eww-x11, eww-wayland and eww which supports both backends)

Philipp-M avatar May 23 '23 16:05 Philipp-M

I believe fixing #739 would be better to be able to use one binary for all backends.

Of course, I agree, my suggestion to build wayland binary without x11 support was just a workaround until #739 is addressed (if this PR were to be merged first). Other option would be to hold off on this PR for now

eclairevoyant avatar May 23 '23 18:05 eclairevoyant

Since it's a simple change, I've updated the PR to support wayland separately (by implicitly disabling the feature x11 (done by nixpkgs upstream). That way it should be ready to merge anyways (the output eww just doesn't support wayland currently due to #739)

Philipp-M avatar May 30 '23 16:05 Philipp-M

https://github.com/NixOS/nixpkgs/pull/239826

adomixaszvers avatar Jun 26 '23 04:06 adomixaszvers

Thanks for the info, I've updated the overlays accordingly (including necessarily the flake inputs).

Philipp-M avatar Jun 26 '23 10:06 Philipp-M

The reliance on nixpkgs has been removed, so these changes seem obsolete to me

w-lfchen avatar Jul 30 '24 08:07 w-lfchen

Yeah, I'll close it, it's very likely obsolete or completely out of date.

Philipp-M avatar Jul 30 '24 08:07 Philipp-M