summary refs log tree commit diff
path: root/nixos/modules/module-list.nix
diff options
context:
space:
mode:
authorAmbroz Bizjak <ambrop7@gmail.com>2018-06-25 14:11:59 +0200
committerAmbroz Bizjak <ambrop7@gmail.com>2018-06-25 16:23:45 +0200
commitd9fa88dfe86b4a884f64ccb785077020a21793e8 (patch)
tree9f77ea5c081543fa6b27e423b15e5fb0ea2e6a08 /nixos/modules/module-list.nix
parent0463c2020e065368fafcca95954ae32bbbdec2e0 (diff)
downloadnixlib-d9fa88dfe86b4a884f64ccb785077020a21793e8.tar
nixlib-d9fa88dfe86b4a884f64ccb785077020a21793e8.tar.gz
nixlib-d9fa88dfe86b4a884f64ccb785077020a21793e8.tar.bz2
nixlib-d9fa88dfe86b4a884f64ccb785077020a21793e8.tar.lz
nixlib-d9fa88dfe86b4a884f64ccb785077020a21793e8.tar.xz
nixlib-d9fa88dfe86b4a884f64ccb785077020a21793e8.tar.zst
nixlib-d9fa88dfe86b4a884f64ccb785077020a21793e8.zip
Use a NixOS module for generating the gdk-pixbuf loaders cache.
Fixes issue #33231 and makes it possible to enable Plasma and KDE at the same time.

Previously, this worked like this:
- The gdk-pixbuf package comes with a cache file covering the modules bundled
  with gdk-pixbuf.
- The librsvg package comes with a cache covering modules from gdk-pixbuf as
  well as librsvg.
- plasma5 and xfce modules set the environment variable GDK_PIXBUF_MODULE_FILE
  to the one from librsvg, so that SVG was supported in addition to the
  formats supported by gdk-pixbuf. However if both were enabled a configuration
  conflict would result (despite setting to the same value).

While this sort of worked (ignoring the conflict which perhaps could be hacked
around), it is unscalable and a hack, as there would be a real problem when one
wanted to add a third package that supports additional image formats.

A new NixOS module (gdk-pixbuf) is added with a configuration option
(modulePackages) that other modules use to request specific packages to be
included in the loaders cache. When any package is present in the list, the
module generates a system-wide loaders cache which includes the requested
packages (and always gdk-pixbuf itself), and sets the environment variable
GDK_PIXBUF_MODULE_FILE to point to the generated cache file.

The plasma5 and xfce modules are updated to add librsvg to modulePackages
instead of setting GDK_PIXBUF_MODULE_FILE.

Note that many packages create wrappers that set GDK_PIXBUF_MODULE_FILE,
some directly to the one from librsvg. Therefore this change does not
change the existing hack in the librsvg package which ensures that
file is generated. This change aims only to solve the conflict in the
global environent variable configuration.
Diffstat (limited to 'nixos/modules/module-list.nix')
-rw-r--r--nixos/modules/module-list.nix1
1 files changed, 1 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 193ef0d1c961..688239b044bf 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -703,6 +703,7 @@
   ./services/x11/hardware/multitouch.nix
   ./services/x11/hardware/synaptics.nix
   ./services/x11/hardware/wacom.nix
+  ./services/x11/gdk-pixbuf.nix
   ./services/x11/redshift.nix
   ./services/x11/urxvtd.nix
   ./services/x11/window-managers/awesome.nix