Skip to content
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/plasma: use upstream xsession/wayland files #100057

Merged
merged 5 commits into from Oct 15, 2021

Conversation

pasqui23
Copy link
Contributor

@pasqui23 pasqui23 commented Oct 8, 2020

Motivation for this change

An updated version of #56988
Wayland still does not work and ~/.local/share/sddm/wayland-session.log is empty after a failed Wayland login,as journalctl -u display-manager.

I will fix the override after making Wayland work

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@worldofpeace worldofpeace added this to the 21.03 milestone Oct 9, 2020
start = startplasma;
};
services.xserver.displayManager.sessionPackages = [ (plasma5.plasma-workspace.overrideAttrs(old:{
passthru.providedSessions=["plasma" "plasmawayland"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can just add this to plasma-workspace, or does libsForQt5.mkDerivation make it so you cant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will,after making it work on wayland

environment.systemPackages =
with qt5; with libsForQt5;
with plasma5; with kdeApplications; with kdeFrameworks;
environment.systemPackages = with pkgs; with qt5; with libsForQt5; with plasma5; with kdeApplications;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like something from the rebase. please revert

@@ -274,7 +268,6 @@ in
plasma-browser-integration
plasma-integration
polkit-kde-agent
spectacle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -298,21 +291,21 @@ in

qtvirtualkeyboard

pkgs.xdg-user-dirs # Update user dirs as described in https://freedesktop.org/wiki/Software/xdg-user-dirs/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

]

# Phonon audio backend
++ lib.optional (cfg.phononBackend == "gstreamer") libsForQt5.phonon-backend-gstreamer
++ lib.optional (cfg.phononBackend == "vlc") libsForQt5.phonon-backend-vlc

# Optional hardware support features
++ lib.optionals config.hardware.bluetooth.enable [ bluedevil bluez-qt pkgs.openobex pkgs.obexftp ]
++ lib.optionals config.hardware.bluetooth.enable [ bluedevil bluez-qt openobex obexftp ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ lib.optional config.networking.networkmanager.enable plasma-nm
++ lib.optional config.hardware.pulseaudio.enable plasma-pa
++ lib.optional config.powerManagement.enable powerdevil
++ lib.optional config.services.colord.enable pkgs.colord-kde
++ lib.optional config.services.colord.enable colord-kde
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ lib.optionals config.services.samba.enable [ kdenetwork-filesharing pkgs.samba ]
++ lib.optional config.services.xserver.wacom.enable pkgs.wacomtablet;
++ lib.optional config.services.xserver.wacom.enable wacomtablet;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -326,7 +319,7 @@ in

fonts.fonts = with pkgs; [ noto-fonts hack-font ];
fonts.fontconfig.defaultFonts = {
monospace = [ "Hack" "Noto Sans Mono" ];
monospace = [ "Hack" "Noto Mono" ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -363,7 +356,7 @@ in

# Update the start menu for each user that is currently logged in
system.userActivationScripts.plasmaSetup = activationScript;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace

inherit (pkgs) kdeApplications kdeFrameworks plasma5;
libsForQt5 = pkgs.libsForQt514;
qt5 = pkgs.qt514;
inherit (pkgs) kdeApplications plasma5 libsForQt5 qt5;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this being qt514 is intentional. guessing rebase artifact

@pasqui23
Copy link
Contributor Author

So the wayland session still quit on startup,but now it does not seem to leave any traces,whether in the journal nor in ~/.local/share/sddm/wayland-session.log `.

@worldofpeace any ideas why?

@hameerabbasi
Copy link

Maybe the description of #44139 will help?

@pasqui23
Copy link
Contributor Author

The wayland entry is present in sddm,but does not work.
Still ,I need to check with QT_DEBUG_PLUGINS=1;QML_IMPORT_TRACE=1;

@pasqui23
Copy link
Contributor Author

Also need to check for wrapQtApps

@pasqui23
Copy link
Contributor Author

@hameerabbasi Checked with the suggested patch,still not working,got in .local/share/sddm/wayland-session.log ;

dbus-daemon[16640]: [session uid=1001 pid=16640] Activating service name='org.freedesktop.systemd1' requested by ':1.0' (uid=1001 pid=16644 comm="/nix/store/90n7mvl7n0zl98wx0jjx2syfma34xhka-dbus-1" label="kernel")
dbus-daemon[16640]: [session uid=1001 pid=16640] Activated service 'org.freedesktop.systemd1' failed: Process org.freedesktop.systemd1 exited with status 1
dbus-update-activation-environment: warning: error sending to systemd: org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.freedesktop.systemd1 exited with status 1
qt.qpa.plugin: Could not load the Qt platform plugin "wayland-org.kde.kwin.qpa" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: wayland-org.kde.kwin.qpa, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

"/nix/store/bkdyka5fa5f707a6hvx8l6v2s37wvwvd-kwin-5.18.5-bin/bin/kwin_wayland" ("--xwayland", "--libinput", "--exit-with-session=/nix/store/2vqimab57z8f8cpbzkax9cwnb1rl997j-plasma-workspace-5.18.5/libexec/startplasma-waylandsession") exited with code 6
startplasmacompositor: Shutting down...
startplasmacompositor: Done.

@matklad
Copy link
Member

matklad commented Oct 28, 2020

@pasqui23 see #43757 (comment)

Specifically, env KWIN_FORCE_OWN_QPA=1 kwin_wayland --version fixes this particular error for me.

@pasqui23
Copy link
Contributor Author

@matklad adding said variable to environment.sessionVariables still does not fix it for me

@poscat0x04 poscat0x04 mentioned this pull request Nov 1, 2020
10 tasks
@CertainLach
Copy link
Contributor

CertainLach commented Dec 22, 2020

Adding KWIN_FORCE_OWN_QPA=1 and increasing limit (0004-start_kdeinit-environ-hard-limit.patch) to 1<<20 makes startplasma_wayland work for me

See #107472 #107476

@CertainLach
Copy link
Contributor

CertainLach commented Dec 25, 2020

For anyone wondering: plasma on wayland is not quite stable on NixOS, screenshots can't be taken because of X-KDE-DBUS-Restricted-Interfaces attribute absence, and plasmashell has some bugs (Task manager shows no apps) because of missing X-KDE-Wayland-Interfaces

Kwin even can't find desktop files for anything, because of wrappers?

KWIN_UTILS: Could not find the desktop file for "/nix/store/v24qakxc15pnj60i7ydqzsd9svdjdjp6-plasma-workspace-5.20.4/bin/.plasmashell-wrapped"
KWIN_UTILS: Could not find the desktop file for "/nix/store/0kbrkb257806lgx5q46gw59scgd2vhqm-yakuake/bin/.yakuake-wrapped"
KWIN_UTILS: Could not find the desktop file for "/nix/store/rabb2qzn14fvq4ksvd063fwcj6d9hwq8-spectacle/bin/.spectacle-wrapped"

See #107595

Copy link
Contributor

@oxalica oxalica left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also waiting for the merge.

@peterhoeg peterhoeg merged commit 0878b46 into NixOS:master Oct 15, 2021
Wayland automation moved this from KDE/Qt specific to General Oct 15, 2021
@pasqui23 pasqui23 deleted the kde-wayland branch October 15, 2021 07:41
@mweinelt
Copy link
Member

This change wasn't converted from markdown to docbook and broke eval on staging-next. This was already visible on the CI changes on this pull request.

https://github.com/NixOS/nixpkgs/runs/3863386514

@cab404
Copy link
Member

cab404 commented Oct 15, 2021

This change wasn't converted from markdown to docbook and broke eval on staging-next. This was already visible on the CI changes on this pull request.

https://github.com/NixOS/nixpkgs/runs/3863386514

fixed in #141818

@mohe2015
Copy link
Contributor

mohe2015 commented Oct 19, 2021

I believe this regressed the clock widget of plasma on Xorg. Can somebody verify please? I bisected to this particular PR. Will test a revert of it shortly.

Edit: Confirmed.

Specifically I reverted 763a001 and 4832352

@mohe2015
Copy link
Contributor

@pasqui23 @peterhoeg @oxalica What do you think?

@pasqui23
Copy link
Contributor Author

No regression on my side,Plasma XOrg on latest nixos unstable.
immagine

Try deleting .cache, often plasma blow out on updates

@mohe2015 mohe2015 mentioned this pull request Oct 19, 2021
12 tasks
@SuperSandro2000
Copy link
Member

Try deleting .cache, often plasma blow out on updates

I am wondering why this is never happening on Debian. I was rocking Debian Unstable for quite a while and never needed to delete the .cache directory.

I believe this regressed the clock widget of plasma on Xorg.

You are sure that sddm did not switch you to wayland? There the clock is missing for me, not Xorg.

@oxalica
Copy link
Contributor

oxalica commented Oct 19, 2021

@mohe2015

I believe this regressed the clock widget of plasma on Xorg.

I fixed the clock widget issue by adding programs.zsh.enable = true in my system configuration since I'm using zsh as default shell but it's configured by home-manager instead of system configuration. It seems your default shell should be enabled in system so that sddm can successfully initialized you environments under wayland.
Please open a terminal under graphical session and check if you have __NIXOS_SET_ENVIRONMENT_DONE set. If not, please ensure your shell is enabled by programs.<shell_name>.enable.

@samueldr
Copy link
Member

Please open a terminal under graphical session and check if you have __NIXOS_SET_ENVIRONMENT_DONE set. If not, please ensure your shell is enabled by programs.<shell_name>.enable.

That might not be enough to check... the terminal may be using a login shell.

I think snooping around /proc/ and the PID of some components of the graphical session may be necessary to validate.

@SuperSandro2000
Copy link
Member

klauncher does not have __NIXOS_SET_ENVIRONMENT_DONE set for me on wayland.


Well, that is not working for bash.

- The option definition `programs.bash.enable' in `/etc/nixos/configuration.nix' no longer has any effect; please remove it.

@mohe2015
Copy link
Contributor

image
We'll I would also consider that a regression. Why does it loose settings.... aargh

@mohe2015
Copy link
Contributor

Should've read release notes...

@mohe2015
Copy link
Contributor

So the only issue remaining is the missing clock on wayland with bash for me. That's probably not a regression though. Would be nice to get a fix as then I may even try wayland for my non-critical stuff. Any idea how to fix that. Home managers bash.enable didn't seem to work.

@oxalica
Copy link
Contributor

oxalica commented Oct 21, 2021

@mohe2015
Could you try running kwriteconfig5 --file startkderc --group General --key systemdBoot true and relogin? This enables "run with systemd mode" for plasma. Maybe it can fix environment variables.

@mohe2015
Copy link
Contributor

@mohe2015 Could you try running kwriteconfig5 --file startkderc --group General --key systemdBoot true and relogin? This enables "run with systemd mode" for plasma. Maybe it can fix environment variables.

Yay, that seems to work. So now we need #117102 ?

@peterhoeg peterhoeg moved this from General to KDE/Qt specific in Wayland Oct 26, 2021
@jerith666
Copy link
Contributor

Grafik-Plattform: Wayland
Well I would also consider that a regression. Why does it loose settings.... aargh

Should've read release notes...

Can someone clarify: was the intention here to make Wayland the default for users who were not ever specifying services.xserver.displayManager.defaultSession? There are two cases:

a) you've got defaultSession = plasma5. The release note is clear about this case: you must change it to plasma or plasmawayland (thus making an explicit decision whether to adopt Wayland now).

b) you've got no value for defaultSession in your config. The release note is vague: if I don't set a value, will i end up with X11 or Wayland?

I'm in case (b), saw the release note, looked at some of the remaining issues (incl. the missing clock issue), and didn't see anything in this issue or elsewhere explicitly saying the default was changing to Wayland. So I assumed that if I left defaultSession unspecified in my config, I'd remain on X11.

Now I've got a missing clock. :-/ Took me a while to circle back to even look at whether I was on X11 or Wayland, but sure enough, I'm on Wayland without intending to be. (In many ways that's a positive -- the switch was almost seamless, and if it hadn't been for the missing clock I probably never would've noticed!)

@SuperSandro2000
Copy link
Member

b) you've got no value for defaultSession in your config. The release note is vague: if I don't set a value, will i end up with X11 or Wayland?

wayland because it comes before x11 in when alphabetically sorting.

@pasqui23
Copy link
Contributor Author

@SuperSandro2000 "plasmawayland" comes before "plasma"?
Also I thought that option errored out if it was not set and there were more than one option.

@SuperSandro2000
Copy link
Member

I am talking about the desktop selection in sddm.

@jerith666
Copy link
Contributor

Also I thought that option errored out if it was not set and there were more than one option.

No, it doesn't. I have only this in my config:

    services.xserver = {
      enable = true;

      desktopManager.plasma5.enable = true;
    };

@bhankas
Copy link
Contributor

bhankas commented Oct 29, 2021

Is there a final fix for missing clock on Wayland? I am using 'fish' as my shell, with 'prgrams.fish.enable = true' already in config, and it hasn't made any difference. Running kwriteconfig5 command mentioned above hasn't worked either. The clock widget is there as far as I can tell, it just doesn't render correctly.

@oxalica
Copy link
Contributor

oxalica commented Oct 29, 2021

@e3bc54b2

Is there a final fix for missing clock on Wayland?

It's introduced again by plasma5 5.23.1 #139657 (comment)
There's a separated issue for it. #143272

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Wayland
  
KDE/Qt specific
Development

Successfully merging this pull request may close these issues.

None yet