-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
sddm: 0.19.0 -> 0.20.0 #239389
sddm: 0.19.0 -> 0.20.0 #239389
Conversation
For some reason, kwin_wayland just explodes when running in SDDM for me, but X11 works fine, so I guess this is not a regression? |
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.
diff LGTM, didn't test
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.
I tested the dwm, dwl, plasma x11, and plasma wayland sessions. All of them worked, even plasma wayland on nvidia.
imho this should be backported to 23.05 |
Absolutely not. This is over three years of development in a single release. |
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.
Old configuration from 0.19.0 still works with my plasma/wayland setup.
The new introduced greeter-on-wayland requires additional kirigami2
and layer-shell-qt
plugins added into sddm's buildInputs
, and the following configurations (copied from Arch wiki):
services.xserver.sddm.settings = {
General.GreeterEnvironment = "QT_WAYLAND_SHELL_INTEGRATION=layer-shell";
General.DisplayServer = "wayland";
General.InputMethod = "";
Wayland.CompositorCommand = "${pkgs.kwin}/bin/kwin_wayland --no-global-shortcuts --no-lockscreen --inputmethod maliit-keyboard --locale1";
};
And it works for me, 🎉 completely without X server! I'm also able to login into and logout from the plasma/wayland session.
I'm not sure if kirigami2
and layer-shell-qt
should be wrapped directly into sddm, or should be retrieved from system profile. kirigami2
is already in systemPackages for sddm, but cannot be not picked up by greeter-on-wayland setup. Not really sure why.
Have not yet successfully make the wayland greeter work inside NixOS tests. The greeter just exited any without useful message.
Are you sure kirigami is necessary? I can't find any references to it in the code. It might be used by Maliit? |
1619e67
to
c2ebd33
Compare
Yes. Without it (also without maliit-keyboard), the greeter shows up for ~0.5s before returning to getty. I guess it might be kwin: https://invent.kde.org/plasma/kwin/-/blob/v5.27.6/CMakeLists.txt?ref_type=tags#L129 |
Then we should probably add it to the KWin wrapper instead. |
Also I think we can ignore maliit for now by not passing |
@@ -69,6 +69,13 @@ let | |||
Session = autoLoginSessionName; | |||
Relogin = cfg.autoLogin.relogin; | |||
}; | |||
} // lib.optionalAttrs cfg.enableKwinWayland { | |||
General = { | |||
GreeterEnvironment = "QT_PLUGIN_PATH=${pkgs.plasma5Packages.layer-shell-qt}/${pkgs.plasma5Packages.qtbase.qtPluginPrefix},QT_WAYLAND_SHELL_INTEGRATION=layer-shell"; |
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.
QT_PLUGIN_PATH
here is not applied somehow. Don't know why.
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.
Why to force layer-shell when upstream uses fullscreen-shell-v1 (I see it's hardcoded in sddm source code)? I don't think kwin supports layer-shell atm, I heard there were talks about switching to it in Plasma 6, but right now AFAIK kwin supports only Plasma's own analogue, plasma-shell.
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.
I just copied the config from upstream Plasma to see if it worked (it didn't), and never got back around to looking into it. I might mess with it more today.
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.
If someone is interested in the link: https://invent.kde.org/plasma/plasma-workspace/-/blob/master/sddm-wayland-session/plasma-wayland.conf . But I also never got that working (when the version was not released) due the error I posted below
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.
sddm code seem to have some special handling of QT_PLUGIN_PATH passing it through processes, so passing it to systemd service might be a better choice. I also don't understand how this is supposed to work given that it doesn't merge the value with the older one but overwrites it, so Qt likely won't even see the wayland platform plugin itself?
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.
Ok, I think I've found where the variable is being reset. sddm uses Qt's QProcessEnvironment::insert(const QProcessEnvironment &e) API shadowing feature a lot (in other words, it inserts a list of variables into another one and if there are conflicts, the newly inserted ones silently get prioritized).
GreeterEnvironment option is being read in HelperApp.cpp. The array is then being shadowed by the result of pam_getenvlist in PamBackend::openSession and by setclassenvironment calls in Backend::openSession.
My guess is QT_PLUGIN_PATH most likely gets overriden by pam_getenvlist as /etc/pam/environment contains QT_PLUGIN_PATH thanks to environment.profileRelativeSessionVariables
.
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.
Patching nixpkgs to get rid of QT_PLUGIN_PATH in environment.profileRelativeSessionVariables makes sddm start with Wayland on my machine. But it obviously doesn't see Plasma Wayland session due to the above-mentioned problem.
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.
replacing sessionEnv.insert(m_pam->getEnv());
with sessionEnv = m_pam->getEnv().insert(sessionEnv);
should also work in theory
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.
Hmm, I wonder if we should take this upstream then.
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.
Yeah, that's a good question, depends on how it's intended to work
Adding kirigami2 to kwin's |
Does kwin depend on Plasma-workspace? If so, yes, we should. |
Oh, sorry my bad. It's plasma-framework that is both the dependency of kwin and the dependent of kirigami2. |
Yeah, that should definitely propagate kirigami then. |
I'm not sure. Maybe it's specifically trying to grab vt1 for those? Either way, I don't think dropping the conflict will be a regression compared to where we stand, and we can figure out the vt1 situation in a followup. |
We have it (x11-user) already working, why to drop it and make a follow-up? This will just make the feature unavailable for some time without any reason IMO. |
Because making it conflict with |
Why you say it doesn't work with tty7? It works for @alois31, it works for me. |
Then it should continue working even if we remove the conflict, because those getties are started on-demand. |
It does run on tty7 for me, but it also crashed with that weird PAM error before the getty conflict was added, which seemed not to be the case for @Shawn8901 and @oxalica . Possibly there is a logind configuration that changes the behavior here. |
Then I guess we can merge this as-is, but we'll have to look over our VT handling in general in the future... |
Apparently some configurations make getty@tty1 running from start. Because it doesn't work for me without such a change. Moreover, sddm even with the current nixos-unstable starts not at every launch for me, maybe due to the same reason, but restarting it helps. |
Wait, which change? With how the branch is right now, we should get a getty on tty1, SDDM on tty2, session on tty3 with rootful X11. |
It also seems somewhat logical to me as the system starts with tty1 enabled, so systemd could just fine start getty with a race condition to sddm |
The SDDM_INITIAL_VT=7. Without this sddm doesn't work in Wayland/x11-user modes for me. |
What VT does the greeter end up on then? 7? |
It says |
In that case we should probably merge this as-is, and then have followups for Wayland and general VT allocation logic. |
It's not a PAM error, your log says PAM works just fine. |
FWIW, Wayland works as well using the following configuration:
The greeter is stable and even feels a bit less glitchy than x11-user, but the keyboard layout is US English. |
Iiiinteresting. If we can use Weston here (or maybe even Cage?), that would save us a lot of headache potentially. |
Weston is the upstream default, so it's just what I tried. In fact, the What should be sorted out though are the input method (without that, I got a full-screen virtual keyboard popping up, and a black screen upon dismissing that), as well as the keyboard layout problem. |
I prefer a single common compositor on a system if possible. Wayland compositors handle all GPU driver and input stuff. I'm worrying that if someone has a exotic keyboard and a uncommon nvidia GPU, they may have double headache trying to mess around both, especially when they have different supported devices. |
I do wonder what the intended setup for this is. Like, does upstream expect to keep using weston? Will distros use whatever compositor they already happen to have? Either way, I think we can discuss all of this on the Wayland PR, and I want to get this (or something similar to it) in first. |
#228045 isn't closed yet. |
Yeah, sddm can't correctly shutdown Wayland sessions when it uses X11 for greeter, it's a long-standing upstream issue. The only workarounds are to use Wayland for sddm itself or to not to use sddm at all. |
Sadly/ weirdly Will Instead the package to use is hardcoded https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/x11/display-managers/sddm.nix#L10 |
You can use a nixpkgs overlay instead. Backporting is unlikely. |
Would adding a I'm not a huge fan of overlays, and the |
I don't see why not, really. |
It's very, very, very likely to produce regressions |
Description of changes
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/
)