NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.48k stars 12.98k forks source link

plasma6: kcm modules broken outside plasma desktop #296999

Open Thra11 opened 3 months ago

Thra11 commented 3 months ago

Describe the bug

Plasma 6 KDE Config Modules don't work outside a plasma 6 session.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Enable plasma6, as well as another window manager such as sway
  2. Start sway
  3. Either open systemsettings and click sound in the left hand side, or run systemsettings kcm_pulseudio from a terminal
  4. Exit sway and start plasma6
  5. Repeat step 3.

Expected behavior

The plasma5 equivalent, systemsettings5, can be run outside of the plasma session. It is useful to be able to set some KDE settings even if you're not actually running KDE/plasma (e.g. if you use KDE applications, you can configure their behaviour and appearance).

Actual behaviour

The KCM GUI can't find some of its runtime dependencies (kirigami-addons for this specific KCM: others have other missing dependencies) when run outside of a plasma6 session. The following appears in a terminal.

> systemsettings kcm_pulseaudio
qt.qml.typeresolution.cycle: Cyclic dependency detected between "qrc:/qt/qml/org/kde/desktop/private/TextFieldContextMenu.qml" and "qrc:/qt/qml/org/kde/desktop/MenuItem.qml"
kf.kcmutils: Error loading QML file qrc:/kcm/kcm_pulseaudio/main.qml
kf.kcmutils:     qrc:/kcm/kcm_pulseaudio/main.qml:19:1: module "org.kde.kirigamiaddons.components" is not installed
    import org.kde.kirigamiaddons.components 1.0 as KirigamiComponents
    ^
qrc:/qt/qml/org/kde/desktop/private/TextFieldContextMenu.qml:235:5: QML MenuItem: Binding loop detected for property "implicitWidth"

The system settings application UI appears, but the "Sound" / pulseaudio page doesn't load and displays the same errors "Error loading QML file." and "qrc:/kcm/kcm_pulseaudio/main.qml:19 module "org.kde.kirigamiaddons.components" is not installed" instead.

I assume plasma6 must be setting the QT_PLUGIN_PATH or some other environment variable to include the runtime qml dependencies that the kcm modules need.

Notify maintainers

@NixOS/qt-kde

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.66-rt19, NixOS, 24.05 (Uakari), 24.05.20240314.d691274`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - nixpkgs: `/home/thrall/nixpkgs`

Add a :+1: reaction to issues you find important.

zendo commented 3 months ago

Related pr: https://github.com/NixOS/nixpkgs/pull/296619

SuperSandro2000 commented 3 months ago

I think kcmutils needs to propagate kirigamiaddons. What do you think @K900 ?

K900 commented 3 months ago

kcmutils shouldn't, plasma-pa should, if anything, but then we have the whole propagatedUserEnvPackages mess again...

Thra11 commented 3 months ago

I agree that it should be plasma-pa that has the dependencies. The KCM (KDE Configuration Modules) are supposed to be modular, so each module should include its own dependencies. If we suppose that plasma-pa is the only KCM module whose config GUI needs kirigami-addons (It almost certainly isn't in reality), then in theory it should be possible for a system without plasma-pa to install and use systemsettings without pulling in kirigami-addons.

I experimented with adding kirigami-addons and kitemmodels to pkgs/kde/plasma/plasma-pa/default.nix, but neither adding them to extraBuildInputs nor extraPropagatedBuildInputs made any difference.

On a 'conventional' linux system, all these dependencies would install their bits in the same location e.g. /usr/share/qt6/plugins or something, which would be included in an environment variable such as QT_PLUGIN_PATH, so . On NixOS, I believe it adds each individual /nix/store/<package>/share/whatever to the environment variable, but I haven't yet had a chance to study how NixOS constructs qt6 / plasma 6 plugins paths.

Random thoughts: