6 ms·
Wayland on NixOS: Confusion, Conquest, Triumph
- sylware 3y agoOne of the breaking of "what we thought for granted" things from core wayland is... there is no vblank. This is because some modern hardware do not have such thing (in "mobile" land). If the hardware provides the luxuary of "presentation" (~vblank) control, an application has to query the appropriate "presentation" wayland interface... namely the application must not expect this interface to be around. You can see that in vulkan3d with its presentation queue: you post your pixels and forget about it (but there are extra presentation interface beyond the core interface like in wayland). It through away everything many knew about rendering timing... for very good reasons, aka not planned obsolescence. This is why many are "wtf" about core wayland. Yes, we reached a point in software where innovation means removing and simplifying, not adding and complexifying. The cherry on top: it makes the wayland core interfaces sooo much simpler, one dev can quickly have a working alternative implementation, and grow it step by step with luxuary extra interfaces. I say that, I am still running good old native x11, because I game on elf/linux (#noproton), but the second the steam client drops its 32bits legacy code and have a working wayland backend, I start to code my own wayland compositor, probably based on the drm/vulkan one from valve deck, but in plain and simple C, or straight to x86_64 assembly (lurking on RISC-V ofc, since porting modern assembly ISAs is brutal but far from being hard).
- bdhcuidbebe 3y agoI game on wayland, using steam and proton/wine. Xwayland works, and wine-wayland fork is functional and in the process of being merged. What is holding you back?
- superkuh 3y agoNone of the handful of different wayland implementations have managed to support any of the network based keyboard/mouse sharing programs like synergy/barrier/input-leap (and vice versa). This lack of functionality is a real dealbreaker for me.
- bdhcuidbebe 3y agoOkay. I use hardware solution for that, so wasn’t aware of issues. is it related to issues with evdev? (my hardware solution is logitech mx keys & their mouse, pair up to 3 machines at once)
- dashboardmess 3y agoWait, does this work on Linux with wayland?
- yjftsjthsd-h 3y agoWhy wouldn't it? It's hardware; it sends the inputs to the machine you tell it to, regardless of whether that machine is running X11 on Linux, Wayland on Linux, or Windows 3.11 on DOS (assume that someone wrote a USB mouse driver for DOS).
- yjftsjthsd-h 3y agoWait, not even a Wayland version of x2vnc? (Since AIUI Wayland does have VNC servers.) That wouldn't take much, surely?
- superkuh 3y agoI have 4 computers and 7 monitors in my keyboard/mouse sharing span. Nothing vnc* is going to do it.
- sylware 3y agoWell, I meant wayland-wayland, not wayland thru Xwayland. I'll keep Xwayland, and those horrible 748397438924 client libs (yeah wayland code is static/private to distributed binaries), for games still missing a wayland backend (with unity/unreal5.x/godot/etc and via libSDL[23], I wonder if that exists on modern elf/linux games unless a custom engine). But it seems the really hard part for valve is dropping their 32bits legacy code which is hardcoded for x11 and opengl... they are adamant at keeping it.
- Jhsto 3y agoPro-tip: use https://github.com/nix-community/nixpkgs-wayland https://github.com/nix-community/nixpkgs-wayland if you want Nvidia support and more frequently updating versions over nixpkgs.
- velcrovan 3y agoProps to those of you still slugging it out in the “Get my fav niche distro to work like a basic desktop OS” trenches. Did a lot of that in my twenties.
- pxc 3y agoWhen I was a teenager, I guess I spent some time like that, wrangling the GNU userland into coherence on Gentoo. But after a couple years, I came out the other side, and that's why I chose to run niche distros as my main OS. I knew that whatever was disagreeable, I could swap out for something else. I knew that whatever was missing, I could package it myself. And at some point, it really did stop being a problem. One of my biggest frustrations at work, where my only choices currently are macOS and Windows, is that they can't seem to provide me a workstation that functions reliably and predictably compared to what I've gotten used to on my 'fav niche distro'. It boggles my mind how unstable contemporary proprietary desktops are, especially when you tack on the meddling of corporate IT with obscure policy tweaks and a host of corporate spyware. I've even found hardware compatibility and integration pretty lacking on both systems compared to NixOS.
- drakerossman 3y agoThank you for your comment velcrovan, but I don't agree with this sentiment. I've been using Ubuntu for personal laptop for a decade, and whatever for a given corporate laptop, and was reluctant to dig into NixOS, until it clicked - the point is to have it done once, and you won't have to do it ever again! NixOS is the only one that allows so.
- WastingMyTime89 3y ago> the point is to have it done once, and you won't have to do it ever again! NixOS is the only one that allows so. Until the tooling introduces a breaking change or new cooler way to do things appear and people stop supporting the old way because "everyone switched anyway". Been there, done that.
- Ericson2314 3y ago
- viraptor 3y agoIn case the author reads this: "use `sudo su`" - this is unnecessary. Sudo already gives you root here. You can use `sudo -i` to get a login shell directly.
- georgyo 3y agoThat's a hyper specific nit you got there, and only referenced once in the middle of the article. However sudo -i, sudo su, and sudo su - are all common ways to achieve the desired result, with very subtle differences. Sudo su - is my preferred method because it puts you into a root login shell rather than just a shell with root privileges. But these are all pretty pandantic to call one way correct, and others incorrect.
- zokier 3y agosudo -i specifically invokes login shell: > Run the shell specified by the target user's password database entry as a login shell. Contrast to -s option: > Run the shell specified by the SHELL environment variable if it is set or the shell specified by the invoking user's password database entry
- viraptor 3y agoIt's not that it's incorrect, it's just unnecessary, same as "sudo sudo". I keep seeing those in various places and when people learn that they trip up in environments where there's no "su" available.
- yjftsjthsd-h 3y agoActually in this specific case I'm not sure why you wouldn't just run `sudo nixos-rebuild [...]`; there's no point in getting a root shell for a single command.
- operator-name 3y agoI've really enjoyed your articles so far. This one took a bit of a turn - by the middle you mention that major DEs support Wayland then suddenly transition into disabling XFCE and installing Sway? It would useful to clarify your audience at the start, and make mention that by default Gnome and KDE already automatically use Wayland if compatible (lady I checked).
- bradrn 3y agoAlas, Xfce doesn’t support Wayland yet… though it appears to be in progress: https://wiki.xfce.org/releng/wayland_roadmap https://wiki.xfce.org/releng/wayland_roadmap
- n8henrie 3y agoJust got around to working on my NixOS sway setup this week. Working better than I had expected! If you want, there are dedicated HM options to use for your key bindings[1] and outputs[2] (ie for your background) instead of putting things in `extraConfig`. [1]: https://nix-community.github.io/home-manager/options.html#opt-wayland.windowManager.sway.config.keybindings https://nix-community.github.io/home-manager/options.html#op... [2]: https://nix-community.github.io/home-manager/options.html#opt-wayland.windowManager.sway.config.output https://nix-community.github.io/home-manager/options.html#op...