diff --git a/common/pc/kde.nix b/common/pc/kde.nix index 2bc3471..efd4e9d 100644 --- a/common/pc/kde.nix +++ b/common/pc/kde.nix @@ -9,6 +9,14 @@ in services.displayManager.sddm.wayland.enable = true; services.desktopManager.plasma6.enable = true; + services.displayManager.sessionPackages = [ + pkgs.plasma-bigscreen + ]; + + # Bigscreen binaries must be on PATH for autostart services, KCMs, and + # internal plasmashell launches (settings, input handler, envmanager, etc.) + environment.systemPackages = [ pkgs.plasma-bigscreen ]; + # kde apps users.users.googlebot.packages = with pkgs; [ # akonadi diff --git a/machines/zoidberg/default.nix b/machines/zoidberg/default.nix index 48cd382..fe3b2b4 100644 --- a/machines/zoidberg/default.nix +++ b/machines/zoidberg/default.nix @@ -35,7 +35,7 @@ "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" ]; - services.displayManager.defaultSession = "plasma"; + services.displayManager.defaultSession = "plasma-bigscreen-wayland"; users.users.cris = { isNormalUser = true; @@ -54,10 +54,10 @@ uid = 1002; }; - # Auto login into Plasma in john zoidberg account + # Auto login into Plasma Bigscreen in john zoidberg account services.displayManager.sddm.settings = { Autologin = { - Session = "plasma"; + Session = "plasma-bigscreen-wayland"; User = "john"; }; }; diff --git a/overlays/default.nix b/overlays/default.nix index fad59b0..020cd56 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -31,4 +31,12 @@ in ../patches/music-assistant-zeroconf-port.patch ]; }); + + # Plasma Bigscreen: TV-optimized KDE shell (not yet packaged in nixpkgs) + plasma-bigscreen = import ./plasma-bigscreen.nix { + inherit (prev.kdePackages) + mkKdeDerivation plasma-workspace plasma-wayland-protocols + qtmultimedia qtwayland qtwebengine qcoro; + inherit (prev) lib fetchFromGitLab pkg-config sdl3 libcec wayland; + }; } diff --git a/overlays/plasma-bigscreen.nix b/overlays/plasma-bigscreen.nix new file mode 100644 index 0000000..444638b --- /dev/null +++ b/overlays/plasma-bigscreen.nix @@ -0,0 +1,79 @@ +{ + mkKdeDerivation, + lib, + fetchFromGitLab, + pkg-config, + plasma-workspace, + qtmultimedia, + qtwayland, + qtwebengine, + qcoro, + plasma-wayland-protocols, + wayland, + sdl3, + libcec, +}: +mkKdeDerivation { + pname = "plasma-bigscreen"; + version = "unstable-2026-03-07"; + + src = fetchFromGitLab { + domain = "invent.kde.org"; + owner = "plasma"; + repo = "plasma-bigscreen"; + rev = "bd143fea7e386bac1652b8150a3ed3d5ef7cf93c"; + hash = "sha256-y439IX7e0+XqxqFj/4+P5le0hA7DiwA+smDsD0UH/fI="; + }; + + patches = [ + ../patches/plasma-bigscreen-input-handler-app-id.patch + ]; + + extraNativeBuildInputs = [ pkg-config ]; + + extraBuildInputs = [ + qtmultimedia + qtwayland + qtwebengine + qcoro + plasma-wayland-protocols + wayland + sdl3 + libcec + ]; + + # Match project version to installed Plasma release so cmake version checks pass + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'set(PROJECT_VERSION "6.5.80")' \ + 'set(PROJECT_VERSION "${plasma-workspace.version}")' + + # Upstream references a nonexistent startplasma-waylandsession binary. + # Fix this in the cmake template (before @KDE_INSTALL_FULL_LIBEXECDIR@ is substituted). + substituteInPlace bin/plasma-bigscreen-wayland.in \ + --replace-fail \ + 'startplasma-wayland --xwayland --libinput --exit-with-session=@KDE_INSTALL_FULL_LIBEXECDIR@/startplasma-waylandsession' \ + 'startplasma-wayland' + ''; + + # FIXME: work around Qt 6.10 cmake API changes + cmakeFlags = [ "-DQT_FIND_PRIVATE_MODULES=1" ]; + + # QML lint fails on missing runtime-only imports (org.kde.private.biglauncher) + # that are only available inside a running Plasma session + dontQmlLint = true; + + postFixup = '' + # Session .desktop references $out/libexec/plasma-dbus-run-session-if-needed + # but the binary lives in plasma-workspace + substituteInPlace "$out/share/wayland-sessions/plasma-bigscreen-wayland.desktop" \ + --replace-fail \ + "$out/libexec/plasma-dbus-run-session-if-needed" \ + "${plasma-workspace}/libexec/plasma-dbus-run-session-if-needed" + + ''; + + passthru.providedSessions = [ "plasma-bigscreen-wayland" ]; + + meta.license = with lib.licenses; [ gpl2Plus ]; +} diff --git a/patches/plasma-bigscreen-input-handler-app-id.patch b/patches/plasma-bigscreen-input-handler-app-id.patch new file mode 100644 index 0000000..b6296f3 --- /dev/null +++ b/patches/plasma-bigscreen-input-handler-app-id.patch @@ -0,0 +1,19 @@ +Use the correct app_id when pre-authorizing remote-desktop portal access. + +The portal's isAppMegaAuthorized() looks up the caller's specific app_id in +the PermissionStore. An empty string only matches apps the portal cannot +identify; it is not a wildcard. Since the input handler is launched via +KIO::CommandLauncherJob with a desktopName, the portal resolves it to the +desktop file ID, so the empty-string entry never matches. + +--- a/inputhandler/xdgremotedesktopsystem.cpp ++++ b/inputhandler/xdgremotedesktopsystem.cpp +@@ -66,7 +67,7 @@ + QDBusReply reply = permissionStore.call(QStringLiteral("SetPermission"), + QStringLiteral("kde-authorized"), // table + true, // create table if not exists + QStringLiteral("remote-desktop"), // id +- QLatin1String(""), // app (empty for host applications) ++ QStringLiteral("org.kde.plasma.bigscreen.inputhandler"), + QStringList{QStringLiteral("yes")}); // permissions +