2020-04-24 23:36:52 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.xserver.gdk-pixbuf;
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
loadersCache = pkgs.gnome._gdkPixbufCacheBuilder_DO_NOT_USE {
|
|
|
|
extraLoaders = lib.unique (cfg.modulePackages);
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
2022-10-30 15:09:59 +00:00
|
|
|
services.xserver.gdk-pixbuf.modulePackages = lib.mkOption {
|
|
|
|
type = lib.types.listOf lib.types.package;
|
2020-04-24 23:36:52 +00:00
|
|
|
default = [ ];
|
2022-08-12 12:06:08 +00:00
|
|
|
description = lib.mdDoc "Packages providing GDK-Pixbuf modules, for cache generation.";
|
2020-04-24 23:36:52 +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-30 15:09:59 +00:00
|
|
|
config = lib.mkIf (cfg.modulePackages != []) {
|
2020-04-24 23:36:52 +00:00
|
|
|
environment.variables = {
|
|
|
|
GDK_PIXBUF_MODULE_FILE = "${loadersCache}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|