Libreoffice standard/GTK installing instead of libreoffice-qt on NixOS unstable

Not sure if this is a bug or if I did something wrong

I have tried both libreoffice-qt and libreoffice-qt-fresh. Installed using configuration.nix

environment.systemPackages = with pkgs; [
libreoffice-qt
];

I previously had it installed on the 23.11 channel but switched over to unstable and it was replaced by the GTK version (it has GTK styling and the menubar doesn’t work in KDE Plasma), even though it seems like both channels should be using the same package for the “fresh” version.

UPDATE: I installed libreoffice-qt from the stable channel and it also seemed to be the GTK version, so I’m not sure if this is a Plasma 6 issue or if the package has been updated recently in both channels or again if I am doing something wrong. Here’s how I installed it from the 23.11 channel.

$ sudo nix-channel --add nixos-23.11 release nixos-23.11.7122.9ddcaffecdf0 nixos-stable
$ sudo nix-channel --update

Then in configuration.nix:

nixpkgs.config = {
allowUnfree = true;
packageOverrides = pkgs: {
stable = import {
config = config.nixpkgs.config;
};
};
};

environment.systemPackages = with pkgs; [
stable.libreoffice-qt
];

Hmm interesting. This line seems suspicious to me:

In conjunction with a possible change in upstream’s ./configure behavior, this may be the issue. It will be a big investment, but I’d try to change that line to --disable-gtk3-kde5, and rebuild (it will take a few hours).

Thanks! How do I do that? (or what can i google to find out how?)

I don’t run KDE so I’m only guessing, but could this be related to:

To test, run: SAL_USE_VCLPLUGIN=kf5 libreoffice

  1. Open a terminal.
  2. git clone https://github.com/NixOS/nixpkgs
  3. Edit the line I mentioned.
  4. Run nix build -Lf. libreoffice-qt
  5. Run the libreoffice you just built, using: ./result/bin/libreoffice

However, I’d try first to run export SAL_USE_VCLPLUGIN=kf5 first with the libreoffice you have already installed globally in $PATH.

1 Like

Running from terminal after running export SAL_USE_VCLPLUGIN=kf5 or export SAL_USE_VCLPLUGIN=qt5 did the trick! Thank you.

2 Likes

You can either add that env variable the NixOS way or the KDE way (more info on that here).

1 Like

I will continue the discussion about a proper solution to this issue in `libreoffice-qt` requires SAL_USE_VCLPLUGIN to be set to kf5 for KDE Plasma 6 · Issue #295015 · NixOS/nixpkgs · GitHub .

2 Likes

“KDE way” didn’t actually work for me, but “NixOS way” did. I just added this to my configuration.nix:

{
  environment.sessionVariables = {
    SAL_USE_VCLPLUGIN = "kf5";
  };
}
1 Like