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

Add Wayland Support #5071

Open
echo-oddly opened this Issue Nov 21, 2014 · 47 comments

Comments

Projects
@echo-oddly
Contributor

echo-oddly commented Nov 21, 2014

I would love to help give NixOS full support for running wayland natively. As you may know wayland is a protocol which aims to replace the antiquated X11 protocol and replace it with something more modern. I'm putting together a list of some tasks . As always, I'm biased and don't know much so any input is greatly appreciated!

  • Weston reference implementation
  • Xwayland support: Run X11 apps on Wayland (#5061)
    • Test essential applications
  • Support for wayland in NixOS config
    • Boot into system compositor
    • Login to session compositor
  • Package applications which support wayland natively
  • Package WMs with wayland and Xwayland support
    • kwin (kde)
    • mutter (gnome)
    • xmonad (no wayland support planned upstream)
    • sway (i3)
    • way-cooler

What do you think? How long would it take? Where is the low hanging fruit and which tasks are most difficult? Thanks for everything and happy hacking!

@vcunat

This comment has been minimized.

Show comment
Hide comment
@vcunat

vcunat Nov 21, 2014

Member

IIRC gtk3 supports wayland natively, so I presume most gtk3 apps should just work out of the box. The whole gnome3 stack should be a low-hanging fruit (because upstream supports it). The WMs you listed are packaged, only they may need some (X)wayland tweaks.

Member

vcunat commented Nov 21, 2014

IIRC gtk3 supports wayland natively, so I presume most gtk3 apps should just work out of the box. The whole gnome3 stack should be a low-hanging fruit (because upstream supports it). The WMs you listed are packaged, only they may need some (X)wayland tweaks.

vcunat added a commit that referenced this issue Nov 24, 2014

Revert "mesa: Don't depend on Wayland"
This reverts commit 7ff232e.
See discussion at the original commit.

CC: #4999, #5001, #5061, #5071.

vcunat referenced this issue Nov 24, 2014

mesa: Don't depend on Wayland
NixOS currently does not have any Wayland support, so it's kinda
pointless ATM to make everything depend on it.
@auntieNeo

This comment has been minimized.

Show comment
Hide comment
@auntieNeo

auntieNeo Feb 5, 2015

Contributor

I have started working on writing NixOS modules for Wayland compositors, out of my own interest in using Wayland as a primary window environment. I have hit a snag where compositors (both weston-launch and swc-launch) will segfault, but only when running as systemd services. I've been sidetracked into trying to collect core dumps of those processes, but I suspect it has something to do with systemd sandboxing.

Right now I'm just making modules as simple systemd services, but I think it might be best to somehow incorporate Wayland sessions into the existing X11 display-manager/session configuration. It is conceivable that one might launch a Wayland compositor from an X11 display manager and vice-versa. I fear this will add a lot of multiplicity to the options, but I believe more than one person will want this during the X11 to Wayland transition period. (Personally, I will just be using auto-login, so I'm open to whatever works)

There have been a number of lesser-known compositors popping up, many of them on github. There's a good list on the Arch Wiki. I might add packages for a few of those as I test them out.

My only goal right now is boot to Wayland. It shouldn't be difficult to do, but doing it right with all of the right options exposed could be tricky.

Contributor

auntieNeo commented Feb 5, 2015

I have started working on writing NixOS modules for Wayland compositors, out of my own interest in using Wayland as a primary window environment. I have hit a snag where compositors (both weston-launch and swc-launch) will segfault, but only when running as systemd services. I've been sidetracked into trying to collect core dumps of those processes, but I suspect it has something to do with systemd sandboxing.

Right now I'm just making modules as simple systemd services, but I think it might be best to somehow incorporate Wayland sessions into the existing X11 display-manager/session configuration. It is conceivable that one might launch a Wayland compositor from an X11 display manager and vice-versa. I fear this will add a lot of multiplicity to the options, but I believe more than one person will want this during the X11 to Wayland transition period. (Personally, I will just be using auto-login, so I'm open to whatever works)

There have been a number of lesser-known compositors popping up, many of them on github. There's a good list on the Arch Wiki. I might add packages for a few of those as I test them out.

My only goal right now is boot to Wayland. It shouldn't be difficult to do, but doing it right with all of the right options exposed could be tricky.

@lethalman

This comment has been minimized.

Show comment
Hide comment
@lethalman

lethalman Feb 5, 2015

Contributor

@auntieNeo consider checking journalctl, most likely you find the reason of the crash there.

About core dumps, it may be worthwhile for you to look at this function:

debugVersion = pkg: lib.overrideDerivation pkg (attrs: {

It will tweak the build of a derivation to include debug symbols.

Also another think you should note, is that opengl needs LD_LIBRARY_PATH to be correctly set. It's done by default on user environments, don't know if it's also in systemd service variables by default.

Contributor

lethalman commented Feb 5, 2015

@auntieNeo consider checking journalctl, most likely you find the reason of the crash there.

About core dumps, it may be worthwhile for you to look at this function:

debugVersion = pkg: lib.overrideDerivation pkg (attrs: {

It will tweak the build of a derivation to include debug symbols.

Also another think you should note, is that opengl needs LD_LIBRARY_PATH to be correctly set. It's done by default on user environments, don't know if it's also in systemd service variables by default.

@vcunat

This comment has been minimized.

Show comment
Hide comment
@vcunat

vcunat Feb 5, 2015

Member

Before inspecting coredumps, just using strace might be more efficient (to see what resources are accessed right before the crash).

Member

vcunat commented Feb 5, 2015

Before inspecting coredumps, just using strace might be more efficient (to see what resources are accessed right before the crash).

@auntieNeo

This comment has been minimized.

Show comment
Hide comment
@auntieNeo

auntieNeo Feb 5, 2015

Contributor

journalctl is what told me that it was segfaulting in the first place. My second instinct was to use strace, but I quickly discovered that setuid-wrapper.c has code that prevents it from running with strace here: https://github.com/NixOS/nixos/blob/master/modules/security/setuid-wrapper.c#L46

Without strace, I figured a core dump would be my only option. It took a while to figure out, but I enabled core dump collection in systemd. I have a pull request that adds the NixOS config niceties for enabling it here: #6168

@lethalman Thanks for the debugVersion tip. I was having trouble getting symbols in my core dump before I started using that.

tl;dr: I found and patched the segfault and sent it upstream. Now that it's working, I'll try to get a NixOS config interface fleshed out that works with multiple system/session compositors.

Contributor

auntieNeo commented Feb 5, 2015

journalctl is what told me that it was segfaulting in the first place. My second instinct was to use strace, but I quickly discovered that setuid-wrapper.c has code that prevents it from running with strace here: https://github.com/NixOS/nixos/blob/master/modules/security/setuid-wrapper.c#L46

Without strace, I figured a core dump would be my only option. It took a while to figure out, but I enabled core dump collection in systemd. I have a pull request that adds the NixOS config niceties for enabling it here: #6168

@lethalman Thanks for the debugVersion tip. I was having trouble getting symbols in my core dump before I started using that.

tl;dr: I found and patched the segfault and sent it upstream. Now that it's working, I'll try to get a NixOS config interface fleshed out that works with multiple system/session compositors.

@lethalman

This comment has been minimized.

Show comment
Hide comment
@lethalman

lethalman Feb 6, 2015

Contributor

Great @auntieNeo , will review your PR about the coredump.

Contributor

lethalman commented Feb 6, 2015

Great @auntieNeo , will review your PR about the coredump.

@trishume

This comment has been minimized.

Show comment
Hide comment
@trishume

trishume Feb 7, 2015

Contributor

This is awesome! NixOS is already awesome and the moment it supports Wayland well I will switch to it for my main computer. Depending on how annoyed I get at my current system I might ragequit earlier and help with the effort. I'm not at that point yet, but it's tempting.

👍

Contributor

trishume commented Feb 7, 2015

This is awesome! NixOS is already awesome and the moment it supports Wayland well I will switch to it for my main computer. Depending on how annoyed I get at my current system I might ragequit earlier and help with the effort. I'm not at that point yet, but it's tempting.

👍

@campadrenalin

This comment has been minimized.

Show comment
Hide comment
@campadrenalin

campadrenalin Feb 19, 2015

Contributor

We have XWayland marked as done, as per previous ticket. However, it's not documented how to install a version of Weston that has the optional dependency supplied. Possibly that's in some more general documentation area, but my google-fu is lacking, and this seems like it should be more straightforward than it is.

Could anyone provide guidance on how to install Weston with XWayland?

Contributor

campadrenalin commented Feb 19, 2015

We have XWayland marked as done, as per previous ticket. However, it's not documented how to install a version of Weston that has the optional dependency supplied. Possibly that's in some more general documentation area, but my google-fu is lacking, and this seems like it should be more straightforward than it is.

Could anyone provide guidance on how to install Weston with XWayland?

@vcunat

This comment has been minimized.

Show comment
Hide comment
@vcunat

vcunat Feb 19, 2015

Member

Weston (the non-lite version) comes with XWayland support. Only it doesn't compile in current master 170775a#commitcomment-9748711.

Member

vcunat commented Feb 19, 2015

Weston (the non-lite version) comes with XWayland support. Only it doesn't compile in current master 170775a#commitcomment-9748711.

@yacinehmito

This comment has been minimized.

Show comment
Hide comment
@yacinehmito

yacinehmito Dec 8, 2015

Contributor

Bumping!

How is the integration of Wayland going? I packaged a Wayland window manager -- see SirCmpwn/sway and my nixpkgs fork for the nix expression -- and I'd like to know if someone thought of an API akin to the X11 one for Nix. I'd very much like to contribute but as it impacts a lot more than this little package I'm afraid to touch anything before getting any insight.

Contributor

yacinehmito commented Dec 8, 2015

Bumping!

How is the integration of Wayland going? I packaged a Wayland window manager -- see SirCmpwn/sway and my nixpkgs fork for the nix expression -- and I'd like to know if someone thought of an API akin to the X11 one for Nix. I'd very much like to contribute but as it impacts a lot more than this little package I'm afraid to touch anything before getting any insight.

@vcunat

This comment has been minimized.

Show comment
Hide comment
@vcunat

vcunat Dec 13, 2015

Member

I don't understand what kind of API you mean; can you explain?

Member

vcunat commented Dec 13, 2015

I don't understand what kind of API you mean; can you explain?

@yacinehmito

This comment has been minimized.

Show comment
Hide comment
@yacinehmito

yacinehmito Dec 13, 2015

Contributor

We have a Nixos module that exposes services.xserver in order to configure the graphic stack to our liking, i. e. which window manager to use, which keyboard layout, which display manager etc. That's what I (perhaps wrongly) called the API.

There is no such thing for wayland. We could turn currently available window managers and desktop environements into services for wayland, provide options to compile widget toolkits with wayland support, set keyboard layouts, enable/disable Xwayland support and whatnot.

I'd like to know if some work has started in this direction or if someone thought about it already. I'm ready to work on it as soon as someone provides clear guidelines, because backward compatibility must be assured for this "API".

The main challenge is the way it may conflict with the already available X11 options, particularly regarding display managers which are currently mandatory to enable the graphic stack on Nixos.

EDIT: By the way, I ask because I packaged the sway window manager but I'm not willing to submit a PR until there's a proper way to configure it.

Contributor

yacinehmito commented Dec 13, 2015

We have a Nixos module that exposes services.xserver in order to configure the graphic stack to our liking, i. e. which window manager to use, which keyboard layout, which display manager etc. That's what I (perhaps wrongly) called the API.

There is no such thing for wayland. We could turn currently available window managers and desktop environements into services for wayland, provide options to compile widget toolkits with wayland support, set keyboard layouts, enable/disable Xwayland support and whatnot.

I'd like to know if some work has started in this direction or if someone thought about it already. I'm ready to work on it as soon as someone provides clear guidelines, because backward compatibility must be assured for this "API".

The main challenge is the way it may conflict with the already available X11 options, particularly regarding display managers which are currently mandatory to enable the graphic stack on Nixos.

EDIT: By the way, I ask because I packaged the sway window manager but I'm not willing to submit a PR until there's a proper way to configure it.

@vcunat

This comment has been minimized.

Show comment
Hide comment
@vcunat

vcunat Dec 14, 2015

Member

I see, at least superficially.

All modules can read all nixos options, I believe, so wayland stuff can start by reading those that make sense in both worlds. We could think of a better structure/names for the options in the meantime. There's a good infrastructure for option renaming at least.

Compiling with wayland support should become the default in nixpkgs, so we can share (most) binaries. We do so already for gtk3 at least (upstream doesn't even support building without wayland IIRC). Feel free to improve the situation.

Member

vcunat commented Dec 14, 2015

I see, at least superficially.

All modules can read all nixos options, I believe, so wayland stuff can start by reading those that make sense in both worlds. We could think of a better structure/names for the options in the meantime. There's a good infrastructure for option renaming at least.

Compiling with wayland support should become the default in nixpkgs, so we can share (most) binaries. We do so already for gtk3 at least (upstream doesn't even support building without wayland IIRC). Feel free to improve the situation.

@auntieNeo

This comment has been minimized.

Show comment
Hide comment
@auntieNeo

auntieNeo Dec 14, 2015

Contributor

@gpyh Regarding the nixos options, that is exactly what I am/was working on. I have some prototype nixos module code here:
https://github.com/auntieNeo/nixrc/tree/master/services/display
And I have some (pseudo-working) example configuration here:
https://github.com/auntieNeo/nixrc/blob/master/profiles/desktop.nix#L161-L244

Some time after starting working on that prototype, it became apparent that the display manager situation had not yet settled down in Wayland. Most X11-based display managers would either require a shim-script to start Wayland compositor, or we would need to use password-less logins with the compositor provided script (weston-init, etc.). Wayland itself doesn't even actually include the concept of display manager; it's really a function of logind.

The GDM people seem to be the only display manager actively working on this (from what I could find). They have some (possibly out of date) info on how they start a Wayland compositor here:
https://wiki.gnome.org/Initiatives/Wayland/gdm

So last I checked, about 6 months ago, the latest GDM (with GNOME on Wayland support) had not yet hit nixos, but it looks like it's here now.

So GDM looks like the place to start. Now that the semester is over I might have a bit of time to poke around at this. Other display managers might need a shim (and probably a different shim for each compositor) for launching Wayland compositors. A complete split from X11 display managers would be the easiest... but uh, there hasn't been any Wayland display managers until recently. :)

The multiplicity of Display Manager + Window Manager + Desktop Manager + Wayland Compositor is mind numbing, so (as a C++ developer) I've been working on abstraction/polymorphism techniques within nix modules to tackle the situation. So it's basically in the "analysis paralysis" phase until I can both 1.) figure out which compositor combinations are most possible/practical/in-demand to reduce the multiplicity and 2.) improve my nix-foo. Advice on either of these points is most helpful.

For now, running the compositor script from the command line (or even as a system service) is pretty easy. It's the login screen and easy configuration that needs to be done.

Contributor

auntieNeo commented Dec 14, 2015

@gpyh Regarding the nixos options, that is exactly what I am/was working on. I have some prototype nixos module code here:
https://github.com/auntieNeo/nixrc/tree/master/services/display
And I have some (pseudo-working) example configuration here:
https://github.com/auntieNeo/nixrc/blob/master/profiles/desktop.nix#L161-L244

Some time after starting working on that prototype, it became apparent that the display manager situation had not yet settled down in Wayland. Most X11-based display managers would either require a shim-script to start Wayland compositor, or we would need to use password-less logins with the compositor provided script (weston-init, etc.). Wayland itself doesn't even actually include the concept of display manager; it's really a function of logind.

The GDM people seem to be the only display manager actively working on this (from what I could find). They have some (possibly out of date) info on how they start a Wayland compositor here:
https://wiki.gnome.org/Initiatives/Wayland/gdm

So last I checked, about 6 months ago, the latest GDM (with GNOME on Wayland support) had not yet hit nixos, but it looks like it's here now.

So GDM looks like the place to start. Now that the semester is over I might have a bit of time to poke around at this. Other display managers might need a shim (and probably a different shim for each compositor) for launching Wayland compositors. A complete split from X11 display managers would be the easiest... but uh, there hasn't been any Wayland display managers until recently. :)

The multiplicity of Display Manager + Window Manager + Desktop Manager + Wayland Compositor is mind numbing, so (as a C++ developer) I've been working on abstraction/polymorphism techniques within nix modules to tackle the situation. So it's basically in the "analysis paralysis" phase until I can both 1.) figure out which compositor combinations are most possible/practical/in-demand to reduce the multiplicity and 2.) improve my nix-foo. Advice on either of these points is most helpful.

For now, running the compositor script from the command line (or even as a system service) is pretty easy. It's the login screen and easy configuration that needs to be done.

@trishume

This comment has been minimized.

Show comment
Hide comment
@trishume

trishume Dec 15, 2015

Contributor

@auntieNeo Do you have an example of what you mean by "Display Manager + Window Manager + Desktop Manager + Wayland Compositor" multiplicity? Aren't the window manager and desktop manager kind of subsumed/tied into the compositor on Wayland?

One thing that might be cool to get working is GDM 3.16 with the default Wayland backend, not a desktop but at least something would be Wayland. Haven't really looked into it but there seems to be some work done here (@lethalman do you know how much is working with that?)

I know that other distros (like recent Fedora) have it so that one display manager can start up either an X11 or a Wayland session. That indicates that it might make sense to extend the current display manager modules to support starting Wayland compositors.

Contributor

trishume commented Dec 15, 2015

@auntieNeo Do you have an example of what you mean by "Display Manager + Window Manager + Desktop Manager + Wayland Compositor" multiplicity? Aren't the window manager and desktop manager kind of subsumed/tied into the compositor on Wayland?

One thing that might be cool to get working is GDM 3.16 with the default Wayland backend, not a desktop but at least something would be Wayland. Haven't really looked into it but there seems to be some work done here (@lethalman do you know how much is working with that?)

I know that other distros (like recent Fedora) have it so that one display manager can start up either an X11 or a Wayland session. That indicates that it might make sense to extend the current display manager modules to support starting Wayland compositors.

@yacinehmito

This comment has been minimized.

Show comment
Hide comment
@yacinehmito

yacinehmito Dec 15, 2015

Contributor

Starting either a X11 or Wayland session from an X11 display manager is not that hard. SDDM and GDM can both do that, it's just up to NixOs to allow it. We just need to point toward the right *.desktop files and fire the Wayland compositor on top of the existing tty.

Getting to boot directly on Wayland on the other hand, that is challenging, and IMHO much more meaningful. I don't know about you but if I run Wayland it is not to see a Xorg process permanently running in the background.

I think that allowing this will heavily affect both the current logind-dm-xorg relationship and the functionalities exposed through the xserver module.

I'm eager to see your coming work @auntieNeo. I won't be of much help except packaging some additional Wayland window managers and writing services and options for them.

Contributor

yacinehmito commented Dec 15, 2015

Starting either a X11 or Wayland session from an X11 display manager is not that hard. SDDM and GDM can both do that, it's just up to NixOs to allow it. We just need to point toward the right *.desktop files and fire the Wayland compositor on top of the existing tty.

Getting to boot directly on Wayland on the other hand, that is challenging, and IMHO much more meaningful. I don't know about you but if I run Wayland it is not to see a Xorg process permanently running in the background.

I think that allowing this will heavily affect both the current logind-dm-xorg relationship and the functionalities exposed through the xserver module.

I'm eager to see your coming work @auntieNeo. I won't be of much help except packaging some additional Wayland window managers and writing services and options for them.

@lethalman

This comment has been minimized.

Show comment
Hide comment
@lethalman

lethalman Jan 13, 2016

Contributor

@trishume I wasn't even able to run gdm 3.16 with X. We have gdm 3.14, it's a hard work to upgrade.

Contributor

lethalman commented Jan 13, 2016

@trishume I wasn't even able to run gdm 3.16 with X. We have gdm 3.14, it's a hard work to upgrade.

@peterhoeg

This comment has been minimized.

Show comment
Hide comment
@peterhoeg

peterhoeg Jul 9, 2016

Member

Regd wayland and KDE:

If you want to give Plasma/Wayland a try I recommend to not just wait for Plasma 5.7 but also for frameworks 5.24.

From: https://blog.martin-graesslin.com/blog/2016/06/wayland-in-plasma-5-7/

Additionally, there is now work by the Debian guys to try and standardize the running of a graphical session via systemd which would also apply here: https://www.mail-archive.com/systemd-devel@lists.freedesktop.org/msg36573.html

Member

peterhoeg commented Jul 9, 2016

Regd wayland and KDE:

If you want to give Plasma/Wayland a try I recommend to not just wait for Plasma 5.7 but also for frameworks 5.24.

From: https://blog.martin-graesslin.com/blog/2016/06/wayland-in-plasma-5-7/

Additionally, there is now work by the Debian guys to try and standardize the running of a graphical session via systemd which would also apply here: https://www.mail-archive.com/systemd-devel@lists.freedesktop.org/msg36573.html

@siddharthist

This comment has been minimized.

Show comment
Hide comment
@siddharthist

siddharthist Jul 16, 2016

Contributor

nixpkgs has the sway window manager, which supports Wayland + XWayland.

Contributor

siddharthist commented Jul 16, 2016

nixpkgs has the sway window manager, which supports Wayland + XWayland.

@tg-x

This comment has been minimized.

Show comment
Hide comment
@tg-x

tg-x Oct 18, 2016

Contributor

Now both GTK and Qt have wayland support enabled.

Added a config.services.xserver.windowManager.sway config option that can be used together with wayland-compatible display managers such as SDDM or GDM -- this still requires an X server, though.

Contributor

tg-x commented Oct 18, 2016

Now both GTK and Qt have wayland support enabled.

Added a config.services.xserver.windowManager.sway config option that can be used together with wayland-compatible display managers such as SDDM or GDM -- this still requires an X server, though.

@groxxda

This comment has been minimized.

Show comment
Hide comment
@groxxda

groxxda Oct 18, 2016

Contributor

Note that GDM from #19081 uses wayland instead of X (at least for the login screen).
Maybe a fellow wayland user want's to test it to get a x-less system (minus xwayland 😄)?
The session file has to be placed in a folder named wayland-session to make gdm aware of its wayland nature (relevant source)

Contributor

groxxda commented Oct 18, 2016

Note that GDM from #19081 uses wayland instead of X (at least for the login screen).
Maybe a fellow wayland user want's to test it to get a x-less system (minus xwayland 😄)?
The session file has to be placed in a folder named wayland-session to make gdm aware of its wayland nature (relevant source)

@spacekitteh

This comment has been minimized.

Show comment
Hide comment
@spacekitteh

spacekitteh Nov 19, 2016

Contributor

Is it possible to use only wayland yet?

Contributor

spacekitteh commented Nov 19, 2016

Is it possible to use only wayland yet?

@vcunat

This comment has been minimized.

Show comment
Hide comment
@vcunat

vcunat Nov 19, 2016

Member

gnome 3.22 worked so recently in the default setting, but it's "temporarily" broken ATM: #19896. I don't know about people using any (other) wayland setup on NixOS, but there may be some.

Member

vcunat commented Nov 19, 2016

gnome 3.22 worked so recently in the default setting, but it's "temporarily" broken ATM: #19896. I don't know about people using any (other) wayland setup on NixOS, but there may be some.

@toogley

This comment has been minimized.

Show comment
Hide comment
@toogley

toogley Dec 24, 2016

@echo-oddly Why is xmonad on your list? As far as i understood this thread, they won't add wayland support in the near future.

toogley commented Dec 24, 2016

@echo-oddly Why is xmonad on your list? As far as i understood this thread, they won't add wayland support in the near future.

@miltador

This comment has been minimized.

Show comment
Hide comment
@miltador

miltador Apr 1, 2017

Contributor

Added way-cooler Wayland wm. Supports Wayland + XWayland.
@echo-oddly, add it please to the list. Thanks!

Contributor

miltador commented Apr 1, 2017

Added way-cooler Wayland wm. Supports Wayland + XWayland.
@echo-oddly, add it please to the list. Thanks!

@vcunat

This comment has been minimized.

Show comment
Hide comment
@vcunat

vcunat Apr 1, 2017

Member

Right. Crossed XMonad and added way-cooler. It's well possible that gnome's wayland works OK already, though there are some gnome problems in general currently. I'm not sure about kwin.

Member

vcunat commented Apr 1, 2017

Right. Crossed XMonad and added way-cooler. It's well possible that gnome's wayland works OK already, though there are some gnome problems in general currently. I'm not sure about kwin.

@toogley

This comment has been minimized.

Show comment
Hide comment
@toogley

toogley Apr 1, 2017

@vcunat I use wayland and gnome on arch linux. And it works great, i had no real issue with it yet. So i can confirm that gnome's wayland works.

(However, i still am forced to use also Xwayland - some apps require that, as far as i remember.)

toogley commented Apr 1, 2017

@vcunat I use wayland and gnome on arch linux. And it works great, i had no real issue with it yet. So i can confirm that gnome's wayland works.

(However, i still am forced to use also Xwayland - some apps require that, as far as i remember.)

@vcunat

This comment has been minimized.

Show comment
Hide comment
@vcunat

vcunat Apr 1, 2017

Member

Well, yes, but I won't tick it until confirmed that it works well on NixOS :-)

Member

vcunat commented Apr 1, 2017

Well, yes, but I won't tick it until confirmed that it works well on NixOS :-)

@toogley

This comment has been minimized.

Show comment
Hide comment
@toogley

toogley Apr 1, 2017

@vcunat ah, okay. i thought you asked about the general experience on linux, not specifically on NixOS.

toogley commented Apr 1, 2017

@vcunat ah, okay. i thought you asked about the general experience on linux, not specifically on NixOS.

@seweu100

This comment has been minimized.

Show comment
Hide comment
@seweu100

seweu100 Apr 7, 2017

Mutter is a wayland compositor since at least late 2016. The first post should be updated.

  • mutter (gnome)

+1 for the issue

seweu100 commented Apr 7, 2017

Mutter is a wayland compositor since at least late 2016. The first post should be updated.

  • mutter (gnome)

+1 for the issue

@hedning

This comment has been minimized.

Show comment
Hide comment
@hedning

hedning Apr 24, 2017

Contributor

For those that are wondering how to actually run gnome-shell in wayland you should be able to run it from a tty like this (kill gnome-shell before you want to switch to another tty though, or else things might hang):

export XCURSOR_PATH="~/.icons:/run/current-system/sw/share/icons"
gnome-shell --wayland

The cursor path is set in the gnome desktop-environement module, so I'm not sure if it's easy to include it in the gnome-shell wrapper, though it would be nice.

Contributor

hedning commented Apr 24, 2017

For those that are wondering how to actually run gnome-shell in wayland you should be able to run it from a tty like this (kill gnome-shell before you want to switch to another tty though, or else things might hang):

export XCURSOR_PATH="~/.icons:/run/current-system/sw/share/icons"
gnome-shell --wayland

The cursor path is set in the gnome desktop-environement module, so I'm not sure if it's easy to include it in the gnome-shell wrapper, though it would be nice.

@samdroid-apps

This comment has been minimized.

Show comment
Hide comment
@samdroid-apps

samdroid-apps Oct 10, 2017

Contributor

Hum, I tried a variation on @hedning's solution by running:

dbus-run-session gnome-shell --wayland

However, it seems to be crashing due to a network manager issue. It might be unrelated. I'll try and look into it, but maybe somebody else has had a similar issue?

sam@vcs ~> dbus-run-session gnome-shell --wayland
Activating service name='org.gtk.vfs.Daemon'
Successfully activated service 'org.gtk.vfs.Daemon'

(gnome-shell:13700): mutter-WARNING **: failed to bind to @/tmp/.X11-unix/X0: Address already in use
Window manager warning: Failed to set environment variable DISPLAY for gnome-session: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.gnome.SessionManager" does not exist
Window manager warning: Failed to set environment variable WAYLAND_DISPLAY for gnome-session: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.gnome.SessionManager" does not exist
Activating service name='org.a11y.Bus'
Successfully activated service 'org.a11y.Bus'
Gjs-Message: JS WARNING: [resource:///org/gnome/shell/ui/main.js 317]: reference to undefined property global.stage
Gjs-Message: JS WARNING: [resource:///org/gnome/shell/ui/layout.js 217]: reference to undefined property global.window_group
Gjs-Message: JS WARNING: [resource:///org/gnome/shell/ui/osdMonitorLabeler.js 59]: reference to undefined property Meta.MonitorManager
Activating service name='org.gnome.Shell.CalendarServer'
Gjs-Message: JS WARNING: [resource:///org/gnome/shell/ui/slider.js 34]: reference to undefined property St.GenericAccessible
Activating service name='org.freedesktop.Telepathy.AccountManager'
Activating service name='org.gtk.vfs.UDisks2VolumeMonitor'
Activating service name='org.gnome.evolution.dataserver.Sources5'
Successfully activated service 'org.freedesktop.Telepathy.AccountManager'
Activating service name='org.freedesktop.Telepathy.Client.Vino'
Successfully activated service 'org.gtk.vfs.UDisks2VolumeMonitor'
Activating service name='org.gtk.vfs.MTPVolumeMonitor'
Successfully activated service 'org.gtk.vfs.MTPVolumeMonitor'
Activating service name='org.gtk.vfs.GPhoto2VolumeMonitor'
Successfully activated service 'org.gtk.vfs.GPhoto2VolumeMonitor'
Gjs-Message: JS WARNING: [resource:///org/gnome/gjs/modules/tweener/tweener.js 540]: reference to undefined property properties[istr].isSpecialProperty
GNOME Shell-Message: Failed to add search provider /run/current-system/sw/share/gnome-shell/search-providers/org.gnome.Characters.search-provider.ini: TypeError: appInfo is null
GNOME Shell-Message: Failed to add search provider /run/current-system/sw/share/gnome-shell/search-providers/org.gnome.Weather.Application.search-provider.ini: TypeError: appInfo is null
Activated service 'org.freedesktop.Telepathy.Client.Vino' failed: Process org.freedesktop.Telepathy.Client.Vino exited with status 1
GNOME Shell-Message: No permission to trigger offline updates: Polkit.Error: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Action org.freedesktop.packagekit.trigger-offline-update is not registered

(gnome-shell:13700): libnm-ERROR **: libnm-util symbols detected; Mixing libnm with libnm-util/libnm-glib is not supported
(EE)
Fatal server error:
(EE) failed to read Wayland events: Connection reset by peer
(EE)
Contributor

samdroid-apps commented Oct 10, 2017

Hum, I tried a variation on @hedning's solution by running:

dbus-run-session gnome-shell --wayland

However, it seems to be crashing due to a network manager issue. It might be unrelated. I'll try and look into it, but maybe somebody else has had a similar issue?

sam@vcs ~> dbus-run-session gnome-shell --wayland
Activating service name='org.gtk.vfs.Daemon'
Successfully activated service 'org.gtk.vfs.Daemon'

(gnome-shell:13700): mutter-WARNING **: failed to bind to @/tmp/.X11-unix/X0: Address already in use
Window manager warning: Failed to set environment variable DISPLAY for gnome-session: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.gnome.SessionManager" does not exist
Window manager warning: Failed to set environment variable WAYLAND_DISPLAY for gnome-session: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.gnome.SessionManager" does not exist
Activating service name='org.a11y.Bus'
Successfully activated service 'org.a11y.Bus'
Gjs-Message: JS WARNING: [resource:///org/gnome/shell/ui/main.js 317]: reference to undefined property global.stage
Gjs-Message: JS WARNING: [resource:///org/gnome/shell/ui/layout.js 217]: reference to undefined property global.window_group
Gjs-Message: JS WARNING: [resource:///org/gnome/shell/ui/osdMonitorLabeler.js 59]: reference to undefined property Meta.MonitorManager
Activating service name='org.gnome.Shell.CalendarServer'
Gjs-Message: JS WARNING: [resource:///org/gnome/shell/ui/slider.js 34]: reference to undefined property St.GenericAccessible
Activating service name='org.freedesktop.Telepathy.AccountManager'
Activating service name='org.gtk.vfs.UDisks2VolumeMonitor'
Activating service name='org.gnome.evolution.dataserver.Sources5'
Successfully activated service 'org.freedesktop.Telepathy.AccountManager'
Activating service name='org.freedesktop.Telepathy.Client.Vino'
Successfully activated service 'org.gtk.vfs.UDisks2VolumeMonitor'
Activating service name='org.gtk.vfs.MTPVolumeMonitor'
Successfully activated service 'org.gtk.vfs.MTPVolumeMonitor'
Activating service name='org.gtk.vfs.GPhoto2VolumeMonitor'
Successfully activated service 'org.gtk.vfs.GPhoto2VolumeMonitor'
Gjs-Message: JS WARNING: [resource:///org/gnome/gjs/modules/tweener/tweener.js 540]: reference to undefined property properties[istr].isSpecialProperty
GNOME Shell-Message: Failed to add search provider /run/current-system/sw/share/gnome-shell/search-providers/org.gnome.Characters.search-provider.ini: TypeError: appInfo is null
GNOME Shell-Message: Failed to add search provider /run/current-system/sw/share/gnome-shell/search-providers/org.gnome.Weather.Application.search-provider.ini: TypeError: appInfo is null
Activated service 'org.freedesktop.Telepathy.Client.Vino' failed: Process org.freedesktop.Telepathy.Client.Vino exited with status 1
GNOME Shell-Message: No permission to trigger offline updates: Polkit.Error: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Action org.freedesktop.packagekit.trigger-offline-update is not registered

(gnome-shell:13700): libnm-ERROR **: libnm-util symbols detected; Mixing libnm with libnm-util/libnm-glib is not supported
(EE)
Fatal server error:
(EE) failed to read Wayland events: Connection reset by peer
(EE)
@jtojnar

This comment has been minimized.

Show comment
Hide comment
@jtojnar

jtojnar Oct 10, 2017

Contributor

I found this bug but it looks like the patch is merged. Maybe a similar bug elsewhere?

Contributor

jtojnar commented Oct 10, 2017

I found this bug but it looks like the patch is merged. Maybe a similar bug elsewhere?

@jtojnar

This comment has been minimized.

Show comment
Hide comment
@jtojnar

jtojnar Oct 10, 2017

Contributor

The following patch was sufficient to get rid of the error and make the Wayland sessoin start:

diff --git a/pkgs/desktops/gnome-3/core/gnome-shell/default.nix b/pkgs/desktops/gnome-3/core/gnome-shell/default.nix
index a694da0844d..419f7431508 100644
--- a/pkgs/desktops/gnome-3/core/gnome-shell/default.nix
+++ b/pkgs/desktops/gnome-3/core/gnome-shell/default.nix
@@ -1,5 +1,5 @@
 { fetchurl, stdenv, pkgconfig, gnome3, json_glib, libcroco, intltool, libsecret
-, python3Packages, libsoup, polkit, clutter, networkmanager, docbook_xsl , docbook_xsl_ns, at_spi2_core
+, python3Packages, python3, libsoup, polkit, clutter, docbook_xsl , docbook_xsl_ns, at_spi2_core
 , libstartup_notification, telepathy_glib, telepathy_logger, libXtst, p11_kit, unzip
 , sqlite, libgweather, libcanberra_gtk3, librsvg, geoclue2
 , libpulseaudio, libical, libtool, nss, gobjectIntrospection, gstreamer, makeWrapper
@@ -19,8 +19,8 @@ in stdenv.mkDerivation rec {
   buildInputs = with gnome3;
     [ gsettings_desktop_schemas gnome_keyring gnome-menus glib gcr json_glib accountsservice
       libcroco intltool libsecret pkgconfig libsoup polkit libcanberra_gtk2 gdk_pixbuf
-      (librsvg.override { enableIntrospection = true; })
-      clutter networkmanager libstartup_notification telepathy_glib docbook_xsl docbook_xsl_ns
+      (librsvg.override { enableIntrospection = true; }) python3
+      clutter libstartup_notification telepathy_glib docbook_xsl docbook_xsl_ns
       libXtst p11_kit networkmanagerapplet gjs mutter libpulseaudio caribou evolution_data_server
       libical libtool nss gtk gstreamer makeWrapper gdm
       libcanberra_gtk3 gnome_control_center geoclue2

Of course it also disabled networking. I guess upstream bug report is in order. Edit: There is https://bugzilla.gnome.org/show_bug.cgi?id=779776

And will need to check if this, by any chance, does not also kill gnome-shell 3.26.

Contributor

jtojnar commented Oct 10, 2017

The following patch was sufficient to get rid of the error and make the Wayland sessoin start:

diff --git a/pkgs/desktops/gnome-3/core/gnome-shell/default.nix b/pkgs/desktops/gnome-3/core/gnome-shell/default.nix
index a694da0844d..419f7431508 100644
--- a/pkgs/desktops/gnome-3/core/gnome-shell/default.nix
+++ b/pkgs/desktops/gnome-3/core/gnome-shell/default.nix
@@ -1,5 +1,5 @@
 { fetchurl, stdenv, pkgconfig, gnome3, json_glib, libcroco, intltool, libsecret
-, python3Packages, libsoup, polkit, clutter, networkmanager, docbook_xsl , docbook_xsl_ns, at_spi2_core
+, python3Packages, python3, libsoup, polkit, clutter, docbook_xsl , docbook_xsl_ns, at_spi2_core
 , libstartup_notification, telepathy_glib, telepathy_logger, libXtst, p11_kit, unzip
 , sqlite, libgweather, libcanberra_gtk3, librsvg, geoclue2
 , libpulseaudio, libical, libtool, nss, gobjectIntrospection, gstreamer, makeWrapper
@@ -19,8 +19,8 @@ in stdenv.mkDerivation rec {
   buildInputs = with gnome3;
     [ gsettings_desktop_schemas gnome_keyring gnome-menus glib gcr json_glib accountsservice
       libcroco intltool libsecret pkgconfig libsoup polkit libcanberra_gtk2 gdk_pixbuf
-      (librsvg.override { enableIntrospection = true; })
-      clutter networkmanager libstartup_notification telepathy_glib docbook_xsl docbook_xsl_ns
+      (librsvg.override { enableIntrospection = true; }) python3
+      clutter libstartup_notification telepathy_glib docbook_xsl docbook_xsl_ns
       libXtst p11_kit networkmanagerapplet gjs mutter libpulseaudio caribou evolution_data_server
       libical libtool nss gtk gstreamer makeWrapper gdm
       libcanberra_gtk3 gnome_control_center geoclue2

Of course it also disabled networking. I guess upstream bug report is in order. Edit: There is https://bugzilla.gnome.org/show_bug.cgi?id=779776

And will need to check if this, by any chance, does not also kill gnome-shell 3.26.

@ylwghst

This comment has been minimized.

Show comment
Hide comment
@ylwghst

ylwghst Oct 19, 2017

Contributor

Same issue as @samdroid-apps on my system.

Contributor

ylwghst commented Oct 19, 2017

Same issue as @samdroid-apps on my system.

@5paceToast

This comment has been minimized.

Show comment
Hide comment
@5paceToast

5paceToast Oct 27, 2017

It is my understanding that kwin_wayland is now obligatory when compiling kwin, which is reinforced by a cursory glance at its cmakelists.
We already depend on it, and I have a (seemingly) fully functional version of it (nested sessions work just fine).

It might make sense to update the original post with:

  • kwin (kde)

Might make sense to experiment with configuration (or at least getting it started manually from tty).

---- update
Checked running startplasmacompositor.
While it does start up, we might need to do some work in that regard - things like dri being unable to access the card (common elsewhere too) and xprop failing to figure out what the correct display is.

5paceToast commented Oct 27, 2017

It is my understanding that kwin_wayland is now obligatory when compiling kwin, which is reinforced by a cursory glance at its cmakelists.
We already depend on it, and I have a (seemingly) fully functional version of it (nested sessions work just fine).

It might make sense to update the original post with:

  • kwin (kde)

Might make sense to experiment with configuration (or at least getting it started manually from tty).

---- update
Checked running startplasmacompositor.
While it does start up, we might need to do some work in that regard - things like dri being unable to access the card (common elsewhere too) and xprop failing to figure out what the correct display is.

@robinvd

This comment has been minimized.

Show comment
Hide comment
@robinvd

robinvd Oct 27, 2017

@5paceToast What did you do to get it to work (from a tty?). All i get when running kde_wayland is a black screen with just a cursor.

robinvd commented Oct 27, 2017

@5paceToast What did you do to get it to work (from a tty?). All i get when running kde_wayland is a black screen with just a cursor.

@peterhoeg

This comment has been minimized.

Show comment
Hide comment
@peterhoeg

peterhoeg Oct 27, 2017

Member

@robinvd, have a look at #30610. I got it working from within sddm: #30610 (comment)

Member

peterhoeg commented Oct 27, 2017

@robinvd, have a look at #30610. I got it working from within sddm: #30610 (comment)

@5paceToast

This comment has been minimized.

Show comment
Hide comment
@5paceToast

5paceToast Oct 27, 2017

@robinvd kde_wayland isn't a command I'm aware of.

If you ran kwin_wayland (and got a black screen with a cursor) that's expected - kwin is just the window manager.

If you want a full plasma session, you want to run startplasmacompositor.

Consider checking kde's wiki on the subject (note: it's quite outdated (e.g it's no longer "tech-preview"), but the section you're interested in in this case is still helpful).

5paceToast commented Oct 27, 2017

@robinvd kde_wayland isn't a command I'm aware of.

If you ran kwin_wayland (and got a black screen with a cursor) that's expected - kwin is just the window manager.

If you want a full plasma session, you want to run startplasmacompositor.

Consider checking kde's wiki on the subject (note: it's quite outdated (e.g it's no longer "tech-preview"), but the section you're interested in in this case is still helpful).

@cmacrae

This comment has been minimized.

Show comment
Hide comment
@cmacrae

cmacrae Nov 26, 2017

Contributor

I'm getting the same issue as @samdroid-apps, too:

$ dbus-run-session gnome-shell --wayland

Activating service name='org.gtk.vfs.Daemon'
Successfully activated service 'org.gtk.vfs.Daemon'
Window manager warning: Failed to set environment variable DISPLAY for gnome-session: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.gnome.SessionManager" does not exist
Window manager warning: Failed to set environment variable WAYLAND_DISPLAY for gnome-session: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.gnome.SessionManager" does not exist
Activating service name='org.a11y.Bus'
Successfully activated service 'org.a11y.Bus'
Gjs-Message: JS WARNING: [resource:///org/gnome/shell/ui/main.js 317]: reference to undefined property global.stage
Gjs-Message: JS WARNING: [resource:///org/gnome/shell/ui/layout.js 217]: reference to undefined property global.window_group
Gjs-Message: JS WARNING: [resource:///org/gnome/shell/ui/osdMonitorLabeler.js 59]: reference to undefined property Meta.MonitorManager
Activating service name='org.gnome.Shell.CalendarServer'
Gjs-Message: JS WARNING: [resource:///org/gnome/shell/ui/slider.js 34]: reference to undefined property St.GenericAccessible
Activating service name='org.freedesktop.Telepathy.AccountManager'
Activating service name='org.gtk.vfs.UDisks2VolumeMonitor'
Successfully activated service 'org.freedesktop.Telepathy.AccountManager'
Activating service name='org.freedesktop.Telepathy.Client.Vino'
Successfully activated service 'org.gtk.vfs.UDisks2VolumeMonitor'
Activating service name='org.gtk.vfs.GPhoto2VolumeMonitor'
Successfully activated service 'org.gtk.vfs.GPhoto2VolumeMonitor'
Activating service name='org.gtk.vfs.MTPVolumeMonitor'
Successfully activated service 'org.gtk.vfs.MTPVolumeMonitor'
Activating service name='org.gnome.evolution.dataserver.Sources5'
Gjs-Message: JS WARNING: [resource:///org/gnome/gjs/modules/tweener/tweener.js 540]: reference to undefined property properties[istr].isSpecialProperty
GNOME Shell-Message: Failed to add search provider /run/current-system/sw/share/gnome-shell/search-providers/org.gnome.Characters.search-provider.ini: TypeError: appInfo is null
GNOME Shell-Message: Failed to add search provider /run/current-system/sw/share/gnome-shell/search-providers/org.gnome.Weather.Application.search-provider.ini: TypeError: appInfo is null
GNOME Shell-Message: No permission to trigger offline updates: Polkit.Error: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Action org.freedesktop.packagekit.trigger-offline-update is not registered
Activated service 'org.freedesktop.Telepathy.Client.Vino' failed: Process org.freedesktop.Telepathy.Client.Vino exited with status 1

(gnome-shell:2320): libnm-ERROR **: libnm-util symbols detected; Mixing libnm with libnm-util/libnm-glib is not supported
(EE)
Fatal server error:
(EE) failed to read Wayland events: Connection reset by peer
(EE)

After some very brief digging, it looks like it might be a library conflict in NetworkManager

Contributor

cmacrae commented Nov 26, 2017

I'm getting the same issue as @samdroid-apps, too:

$ dbus-run-session gnome-shell --wayland

Activating service name='org.gtk.vfs.Daemon'
Successfully activated service 'org.gtk.vfs.Daemon'
Window manager warning: Failed to set environment variable DISPLAY for gnome-session: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.gnome.SessionManager" does not exist
Window manager warning: Failed to set environment variable WAYLAND_DISPLAY for gnome-session: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.gnome.SessionManager" does not exist
Activating service name='org.a11y.Bus'
Successfully activated service 'org.a11y.Bus'
Gjs-Message: JS WARNING: [resource:///org/gnome/shell/ui/main.js 317]: reference to undefined property global.stage
Gjs-Message: JS WARNING: [resource:///org/gnome/shell/ui/layout.js 217]: reference to undefined property global.window_group
Gjs-Message: JS WARNING: [resource:///org/gnome/shell/ui/osdMonitorLabeler.js 59]: reference to undefined property Meta.MonitorManager
Activating service name='org.gnome.Shell.CalendarServer'
Gjs-Message: JS WARNING: [resource:///org/gnome/shell/ui/slider.js 34]: reference to undefined property St.GenericAccessible
Activating service name='org.freedesktop.Telepathy.AccountManager'
Activating service name='org.gtk.vfs.UDisks2VolumeMonitor'
Successfully activated service 'org.freedesktop.Telepathy.AccountManager'
Activating service name='org.freedesktop.Telepathy.Client.Vino'
Successfully activated service 'org.gtk.vfs.UDisks2VolumeMonitor'
Activating service name='org.gtk.vfs.GPhoto2VolumeMonitor'
Successfully activated service 'org.gtk.vfs.GPhoto2VolumeMonitor'
Activating service name='org.gtk.vfs.MTPVolumeMonitor'
Successfully activated service 'org.gtk.vfs.MTPVolumeMonitor'
Activating service name='org.gnome.evolution.dataserver.Sources5'
Gjs-Message: JS WARNING: [resource:///org/gnome/gjs/modules/tweener/tweener.js 540]: reference to undefined property properties[istr].isSpecialProperty
GNOME Shell-Message: Failed to add search provider /run/current-system/sw/share/gnome-shell/search-providers/org.gnome.Characters.search-provider.ini: TypeError: appInfo is null
GNOME Shell-Message: Failed to add search provider /run/current-system/sw/share/gnome-shell/search-providers/org.gnome.Weather.Application.search-provider.ini: TypeError: appInfo is null
GNOME Shell-Message: No permission to trigger offline updates: Polkit.Error: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Action org.freedesktop.packagekit.trigger-offline-update is not registered
Activated service 'org.freedesktop.Telepathy.Client.Vino' failed: Process org.freedesktop.Telepathy.Client.Vino exited with status 1

(gnome-shell:2320): libnm-ERROR **: libnm-util symbols detected; Mixing libnm with libnm-util/libnm-glib is not supported
(EE)
Fatal server error:
(EE) failed to read Wayland events: Connection reset by peer
(EE)

After some very brief digging, it looks like it might be a library conflict in NetworkManager

@jtojnar

This comment has been minimized.

Show comment
Hide comment
@jtojnar

jtojnar Nov 26, 2017

Contributor

@cmacrae Yes, see above

Contributor

jtojnar commented Nov 26, 2017

@cmacrae Yes, see above

@cmacrae

This comment has been minimized.

Show comment
Hide comment
@cmacrae

cmacrae Nov 26, 2017

Contributor

Ah, cheers @jtojnar 👍

Contributor

cmacrae commented Nov 26, 2017

Ah, cheers @jtojnar 👍

@Baughn

This comment has been minimized.

Show comment
Hide comment
@Baughn

Baughn Dec 19, 2017

Contributor

As an anecdote, I tried following instructions here ("Run gnome-shell --wayland"), which failed because there's no /dev/dri directory and thus no KMS device.

The device does exist, as per /proc/devices, but there's no udev rule creating the device nodes -- and I'm not sure what's supposed to do so. Presumably that happens as part of the normal X infrastructure, which I've deliberately disabled. A Wayland-based system shouldn't need to be running an X window manager.

Contributor

Baughn commented Dec 19, 2017

As an anecdote, I tried following instructions here ("Run gnome-shell --wayland"), which failed because there's no /dev/dri directory and thus no KMS device.

The device does exist, as per /proc/devices, but there's no udev rule creating the device nodes -- and I'm not sure what's supposed to do so. Presumably that happens as part of the normal X infrastructure, which I've deliberately disabled. A Wayland-based system shouldn't need to be running an X window manager.

@peterhoeg peterhoeg added this to General in Wayland Dec 21, 2017

@Baughn

This comment has been minimized.

Show comment
Hide comment
@Baughn

Baughn Dec 23, 2017

Contributor

Allow me to retract my previous comment. After some hair-pulling, and a lot of debugging, it turned out to be a kernel issue -- to wit, the GPU driver was subtly broken on 4.9 in a way that let X fall back to pure 2D output. Wayland, of course, depends on OpenGL being available.

Some of it may still be applicable, but I'll sort that out by way of PRs instead.

Contributor

Baughn commented Dec 23, 2017

Allow me to retract my previous comment. After some hair-pulling, and a lot of debugging, it turned out to be a kernel issue -- to wit, the GPU driver was subtly broken on 4.9 in a way that let X fall back to pure 2D output. Wayland, of course, depends on OpenGL being available.

Some of it may still be applicable, but I'll sort that out by way of PRs instead.

@hedning

This comment has been minimized.

Show comment
Hide comment
@hedning

hedning Feb 3, 2018

Contributor

I'm able to run Gnome Shell (3.26 in my case) on Wayland like this now:

XDG_SESSION_TYPE=wayland dbus-run-session $(nix-build --no-out-link '<nixpkgs>' -A gnome3.gnome_session)/bin/gnome-session
Contributor

hedning commented Feb 3, 2018

I'm able to run Gnome Shell (3.26 in my case) on Wayland like this now:

XDG_SESSION_TYPE=wayland dbus-run-session $(nix-build --no-out-link '<nixpkgs>' -A gnome3.gnome_session)/bin/gnome-session
@samdroid-apps

This comment has been minimized.

Show comment
Hide comment
@samdroid-apps

samdroid-apps Feb 3, 2018

Contributor

I was able to run @hedning's method. But using that method, I needed to run it inside a nix-shell with glib.dev installed; as it failed without the gsettings command in the PATH.

So my script is:

#! /usr/bin/env nix-shell
#! nix-shell -p glib.dev -i bash
XDG_SESSION_TYPE=wayland dbus-run-session $(nix-build '<nixpkgs>' -A gnome3.gnome_session)/bin/gnome-session

I've played around with setting up a systemd unit to do it; but I can't fix environment errors relating to gsettings schemas:

  systemd.services.display-manager = lib.mkForce {
    description = "The worst way to run a wayland session";

    # needs gsettings in path
    # dbus-run-session expects other dbus binaries to be in PATH
    # gnome-session needs path in path
    path = with pkgs; [ glib.dev dbus bash ];
    script = let
      cfg = {
        # default from gnome3 service
        sessionPath = [ pkgs.gnome3.gnome_shell pkgs.gnome3.gnome-shell-extensions ];
      };
    in ''
      . /etc/profile

          ${lib.concatMapStrings (p: ''
            if [ -d "${p}/share/gsettings-schemas/${p.name}" ]; then
              export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share/gsettings-schemas/${p.name}
            fi

            if [ -d "${p}/lib/girepository-1.0" ]; then
              export GI_TYPELIB_PATH=$GI_TYPELIB_PATH''${GI_TYPELIB_PATH:+:}${p}/lib/girepository-1.0
              export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${p}/lib
            fi
          '') cfg.sessionPath}

      # The top of this script is copied from the gnome3 service
      # Set GTK_DATA_PREFIX so that GTK+ can find the themes
      export GTK_DATA_PREFIX=${config.system.path}

      # find theme engines
      export GTK_PATH=${config.system.path}/lib/gtk-3.0:${config.system.path}/lib/gtk-2.0

      export XDG_MENU_PREFIX=gnome-

      echo $XDG_DATA_DIRS

      # Let nautilus find extensions
      export NAUTILUS_EXTENSION_DIR=${config.system.path}/lib/nautilus/extensions-3.0/

      # Find the mouse
      export XCURSOR_PATH=~/.icons:${config.system.path}/share/icons

      # Update user dirs as described in http://freedesktop.org/wiki/Software/xdg-user-dirs/
      ${pkgs.xdg-user-dirs}/bin/xdg-user-dirs-update

      

      # WAYLAND SPECIFIC CODE
      export XDG_SESSION_TYPE=wayland
      dbus-run-session ${pkgs.gnome3.gnome_session}/bin/gnome-session
    '';
    
    # copied from nixpkgs: https://github.com/NixOS/nixpkgs/blob/dddcd10ecce21237f8b7f8abf6acd0938bff095e/nixos/modules/services/x11/xserver.nix#L633
    after = [ "systemd-udev-settle.service" "local-fs.target" "acpid.service" "systemd-logind.service" ];
    wants = [ "systemd-udev-settle.service" ];

    # restartIfChanged = false;

    serviceConfig = {
      Restart = "always";
      RestartSec = "200ms";
      SyslogIdentifier = "display-manager";
      # Stop restarting if the display manager stops (crashes) 2 times
      # in one minute. Starting X typically takes 3-4s.
      StartLimitInterval = "30s";
      StartLimitBurst = "3";

      # TODO: put your username in here
      User = "sam";
      Group = "nogroup";
    };
  };
Contributor

samdroid-apps commented Feb 3, 2018

I was able to run @hedning's method. But using that method, I needed to run it inside a nix-shell with glib.dev installed; as it failed without the gsettings command in the PATH.

So my script is:

#! /usr/bin/env nix-shell
#! nix-shell -p glib.dev -i bash
XDG_SESSION_TYPE=wayland dbus-run-session $(nix-build '<nixpkgs>' -A gnome3.gnome_session)/bin/gnome-session

I've played around with setting up a systemd unit to do it; but I can't fix environment errors relating to gsettings schemas:

  systemd.services.display-manager = lib.mkForce {
    description = "The worst way to run a wayland session";

    # needs gsettings in path
    # dbus-run-session expects other dbus binaries to be in PATH
    # gnome-session needs path in path
    path = with pkgs; [ glib.dev dbus bash ];
    script = let
      cfg = {
        # default from gnome3 service
        sessionPath = [ pkgs.gnome3.gnome_shell pkgs.gnome3.gnome-shell-extensions ];
      };
    in ''
      . /etc/profile

          ${lib.concatMapStrings (p: ''
            if [ -d "${p}/share/gsettings-schemas/${p.name}" ]; then
              export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share/gsettings-schemas/${p.name}
            fi

            if [ -d "${p}/lib/girepository-1.0" ]; then
              export GI_TYPELIB_PATH=$GI_TYPELIB_PATH''${GI_TYPELIB_PATH:+:}${p}/lib/girepository-1.0
              export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${p}/lib
            fi
          '') cfg.sessionPath}

      # The top of this script is copied from the gnome3 service
      # Set GTK_DATA_PREFIX so that GTK+ can find the themes
      export GTK_DATA_PREFIX=${config.system.path}

      # find theme engines
      export GTK_PATH=${config.system.path}/lib/gtk-3.0:${config.system.path}/lib/gtk-2.0

      export XDG_MENU_PREFIX=gnome-

      echo $XDG_DATA_DIRS

      # Let nautilus find extensions
      export NAUTILUS_EXTENSION_DIR=${config.system.path}/lib/nautilus/extensions-3.0/

      # Find the mouse
      export XCURSOR_PATH=~/.icons:${config.system.path}/share/icons

      # Update user dirs as described in http://freedesktop.org/wiki/Software/xdg-user-dirs/
      ${pkgs.xdg-user-dirs}/bin/xdg-user-dirs-update

      

      # WAYLAND SPECIFIC CODE
      export XDG_SESSION_TYPE=wayland
      dbus-run-session ${pkgs.gnome3.gnome_session}/bin/gnome-session
    '';
    
    # copied from nixpkgs: https://github.com/NixOS/nixpkgs/blob/dddcd10ecce21237f8b7f8abf6acd0938bff095e/nixos/modules/services/x11/xserver.nix#L633
    after = [ "systemd-udev-settle.service" "local-fs.target" "acpid.service" "systemd-logind.service" ];
    wants = [ "systemd-udev-settle.service" ];

    # restartIfChanged = false;

    serviceConfig = {
      Restart = "always";
      RestartSec = "200ms";
      SyslogIdentifier = "display-manager";
      # Stop restarting if the display manager stops (crashes) 2 times
      # in one minute. Starting X typically takes 3-4s.
      StartLimitInterval = "30s";
      StartLimitBurst = "3";

      # TODO: put your username in here
      User = "sam";
      Group = "nogroup";
    };
  };
@jtojnar

This comment has been minimized.

Show comment
Hide comment
@jtojnar

jtojnar Feb 3, 2018

Contributor

I was able to run @hedning's method. But using that method, I needed to run it inside a nix-shell with glib.dev installed; as it failed without the gsettings command in the PATH.

Weird, gnome-session should be wrapped:

--prefix PATH : "${glib.dev}/bin" \

Contributor

jtojnar commented Feb 3, 2018

I was able to run @hedning's method. But using that method, I needed to run it inside a nix-shell with glib.dev installed; as it failed without the gsettings command in the PATH.

Weird, gnome-session should be wrapped:

--prefix PATH : "${glib.dev}/bin" \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment