-
-
Notifications
You must be signed in to change notification settings - Fork 13k
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
nixos/sddm: enable Wayland support #242009
Conversation
Split off the Plasma cleanups into #242224. |
I was not able to get the Wayland greeter working using KWin. Both KWin and the greeter itself seem to start, but I just see a black screen. However, I was able to get it working using Weston with the following configuration: services.xserver.displayManager.sddm.settings = {
General = {
DisplayServer = "wayland";
InputMethod = "";
};
Wayland.CompositorCommand = let
xcfg = config.services.xserver;
westonIni = (pkgs.formats.ini {}).generate "weston.ini" {
libinput = {
enable-tap = xcfg.libinput.mouse.tapping;
left-handed = xcfg.libinput.mouse.leftHanded;
};
keyboard = {
keymap_model = xcfg.xkbModel;
keymap_layout = xcfg.layout;
keymap_variant = xcfg.xkbVariant;
keymap_options = xcfg.xkbOptions;
};
};
in "${pkgs.weston}/bin/weston --shell=fullscreen-shell.so -c ${westonIni}";
}; Unfortunately, Weston does not read the keyboard/libinput settings from the usual locations itself, and needs a configuration file. However, this configuration file can be generated from the declarative configuration file, as shown above for what I thought are the most important options. The greeter for some reason still claims the keyboard layout is US English (lol), but typing confirms that the correct layout was picked up. I did not get the virtual keyboard working even with Weston, so the configuration still has |
I was. And IMO it's worth the effort. |
it's the right value on Wayland, empty value means default which is the text-input protocol on Wayland. The compositor can then provide CJK, virtual keyboard or whatever else. |
Did it work with the configuration from this PR, or did you require extra changes? |
Yes, with extra changes mentioned in the previous PR (getting rid of QT_PLUGIN_PATH from environment.profileRelativeSessionVariables) |
I managed to get it working now without this, by adding |
Yeah, there are also likely other workarounds like adding layer-shell-qt to environment.sessionVariables |
Adding environment variables via sddm-greeter.pam should also work theoretically |
With these changes it works like a charm!
PS: while on it, I checked which tty it actually occupies: it's tty2. |
Oops, it was a mistest, forgot to set enableKwinWayland. It actually occupies tty7 so SDDM_INITIAL_VT seem to have effect. It still works like a charm. |
Maybe we should just wrap the greeter with layer-shell-qt, it's a tiny closure size change and it saves a lot of, well, this. |
That's basically what adding it to |
Honestly, the more I think about it, the more convinced I am that forcing KWin here is not the way to go. It's missing support for things like DPMS, and it's just diverging from upstream for ... what exactly? A few megabytes of closure size? |
OK, I think I like the state of things now. I've cherry-picked the major fixes that should allow running other compositors should you want to, but the module only supports Weston, to match upstream. |
Without setting |
This should be fixed with the last force push. |
I was already patching that one in, seems that it doesn't work properly. |
Just to make sure, you have sddm/sddm@07631f2 applied, correct? |
How is that happened? I patch nixpkgs with the changes I proposed for this and sddm wayland works just fine with kwin.
Is this a typo? KWin is advanced while Weston is basic.
For proper functionality. I bet there will be a lot of problems with Weston. |
Yes, that one is applied (and I verified that the correct SDDM is put into my |
That was me testing it without the patches. With the patches, it should work.
No, it's not in fact a typo. KWin relies on KScreen for display power management, which does not run in the SDDM "session". Weston has it integrated.
No but like, specifically? What functionality is required to run a greeter that Weston is missing? |
That's weird. Do you have |
After applying all the patches KWin works (not sure about the InputMethod stuff, I only tested with Weston).
The only I have noticed with Weston that doesn't happen with KWin is the unnecessary modeset, which is purely cosmetic. Upstream default is Weston, and I guess that means it at least works somewhat properly. |
Right now, yes, it's empty because I set it that way so that SDDM works. On the broken configuration there is no InputMethod entry in sddm.conf. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The InputMethod issue appears to have been caused by testing a stale SDDM on my end. Everything appears to work well (except for the known cosmetic issues), it's nice and simple, in line with upstream defaults, and people who really want to use KWin can do so without recompiling SDDM.
It's not a matter of required but a matter of nice to have I guess. WIth Weston it will work but with kwin it will work way more nicely I believe. E.g. Weston seem to not to support xdg-positioner (at least I have popups out of screen when running weston nested to test something). |
Does the greeter actually use that? I'm pretty sure it's just rendering everything into one big fullscreen surface. |
idk honestly. I only know my experience with Weston wasn't great. |
With Weston as a general desktop compositor or specifically when running a greeter? Like, the requirements are a lot lower here. |
Should I create a new issue about this? I'm not very familiar with xserver module, but to me (sway user) it looks like it does a bunch of things I don't really need. I just want to enable 2 options in my config and get sddm without any X-junk in my system. |
What do you mean by "a bunch of things you don't really need"? |
It requires xserver to be enabled. nixpkgs/nixos/modules/services/x11/display-managers/sddm.nix Lines 221 to 227 in 0f6fb14
|
It doesn't, that option is badly named. If you use |
Relevant: #94799 |
Yes, I know, but it still install packages and creates configs |
That is tracked in #94799 and requires a serious refactoring of the |
Description of changes
Split off from #239389.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)