NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.34k stars 13.58k forks source link

GDK_PIXBUF_MODULE_FILE should not be set in DE modules (KDE, Xfce) #33231

Closed jaens closed 5 years ago

jaens commented 6 years ago

Issue description

Having both enabled at once in NixOS results in the following error: error: The unique option 'environment.variables.GDK_PIXBUF_MODULE_FILE' is defined multiple times, in '/home/jaen/Repositories/nixpkgs/nixos/modules/services/x11/desktop-managers/plasma5.nix' and '/home/jaen/Repositories/nixpkgs/nixos/modules/services/x11/desktop-managers/xfce.nix'.

(on the nixos-unstable channel)

Steps to reproduce

  services.xserver.desktopManager.plasma5.enable = true;
  services.xserver.desktopManager.xfce.enable = true;

Technical details

 - system: `"x86_64-linux"`
 - host os: `Linux 4.14.5, NixOS, 18.03.git.8989149 (Impala)`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 1.11.16`
 - channels(root): `"nixos-18.03pre122666.afe9649210c"`
 - channels(jaen): `""`
 - nixpkgs: `/home/jaen/Repositories/nixpkgs`
jaens commented 6 years ago

Looks like the conflict was introduced in 209cbf9fc7e7d70d254abf457f154a934201f420 cc @yegortimoshenko

lukateras commented 6 years ago

Indeed.

lukateras commented 6 years ago

I'll make a superficial fix, but I'm really not sure how to really resolve this. This environment variable isn't really specific to KDE or Xfce. Would it perhaps be a good idea to wrap all Gtk apps to have GDK_PIXBUF_MODULE_FILE?

/cc @jtojnar (GNOME), @ttuegel (KDE)

lukateras commented 6 years ago

@jaens: conflict has been fixed in https://github.com/NixOS/nixpkgs/commit/0dd6bd214da0b3ec79400a2910a0ca0a580eccf8, so you can enable KDE and Xfce at the same time, but underlying problem is not resolved yet, so I'm leaving the issue open.

jtojnar commented 6 years ago

IMHO, these things should be done in the derivation (for an example, see nautilus), possibly in some more automated way.

ttuegel commented 6 years ago

IMHO, these things should be done in the derivation (for an example, see nautilus), possibly in some more automated way.

This is done by wrapGAppsHook. The problem is, KDE needs GTK applications to support SVG icons, which requires a different module file than the wrapper uses. It looks like Xfce needs the same thing.

The correct solution is for KDE and Xfce to make the setting in their respective startup scripts.

lukateras commented 6 years ago

As I understand, currently SVG icons in GTK apps are broken in most environments, the only reason it might not be entirely obvious is that most themes and apps also package raster icons. It's not Xfce's or KDE's fault in any way, and icons would be as broken in, say, just bare Xmonad.

In that case I don't see any solution better than depending on librsvg in all GTK apps.

burjui commented 6 years ago

This is still a problem. Is there any solution?

ambrop72 commented 6 years ago

I have developed a solution in pull request https://github.com/NixOS/nixpkgs/pull/42562. The change is against master but applies cleanly to 18.03. With this I can successfully enable Xfce and Plasma at the same time, and run Thunar from a Plasma session.

jtojnar commented 5 years ago

Fixed in #42562