2020-04-24 23:36:52 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2024-06-20 14:57:18 +00:00
|
|
|
cfg = config.programs.gdk-pixbuf;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
loadersCache = pkgs.gnome._gdkPixbufCacheBuilder_DO_NOT_USE {
|
2024-06-20 14:57:18 +00:00
|
|
|
extraLoaders = lib.unique cfg.modulePackages;
|
2022-10-30 15:09:59 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
2024-06-20 14:57:18 +00:00
|
|
|
imports = [
|
|
|
|
(lib.mkRenamedOptionModule [ "services" "xserver" "gdk-pixbuf" ] [ "programs" "gdk-pixbuf" ])
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
options = {
|
2024-06-20 14:57:18 +00:00
|
|
|
programs.gdk-pixbuf.modulePackages = lib.mkOption {
|
2022-10-30 15:09:59 +00:00
|
|
|
type = lib.types.listOf lib.types.package;
|
2020-04-24 23:36:52 +00:00
|
|
|
default = [ ];
|
2024-04-21 15:54:59 +00:00
|
|
|
description = "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 != []) {
|
2023-03-27 19:17:25 +00:00
|
|
|
environment.sessionVariables = {
|
2024-06-20 14:57:18 +00:00
|
|
|
GDK_PIXBUF_MODULE_FILE = loadersCache;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|