2018-06-25 12:11:59 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.xserver.gdk-pixbuf;
|
|
|
|
|
2022-10-21 07:42:13 +00:00
|
|
|
loadersCache = pkgs.gnome._gdkPixbufCacheBuilder_DO_NOT_USE {
|
|
|
|
extraLoaders = lib.unique (cfg.modulePackages);
|
|
|
|
};
|
2018-06-25 12:11:59 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
2022-10-21 07:42:13 +00:00
|
|
|
services.xserver.gdk-pixbuf.modulePackages = lib.mkOption {
|
|
|
|
type = lib.types.listOf lib.types.package;
|
2018-06-25 12:11:59 +00:00
|
|
|
default = [ ];
|
2022-07-28 21:19:15 +00:00
|
|
|
description = lib.mdDoc "Packages providing GDK-Pixbuf modules, for cache generation.";
|
2018-06-25 12:11:59 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# If there is any package configured in modulePackages, we generate the
|
|
|
|
# loaders.cache based on that and set the environment variable
|
|
|
|
# GDK_PIXBUF_MODULE_FILE to point to it.
|
2022-10-21 07:42:13 +00:00
|
|
|
config = lib.mkIf (cfg.modulePackages != []) {
|
2018-06-25 12:11:59 +00:00
|
|
|
environment.variables = {
|
|
|
|
GDK_PIXBUF_MODULE_FILE = "${loadersCache}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|