depot/third_party/nixpkgs/nixos/modules/services/x11/gdk-pixbuf.nix
Default email 92b3d6365d Project import generated by Copybara.
GitOrigin-RevId: 412b9917cea092f3d39f9cd5dead4effd5bc4053
2022-10-30 16:09:59 +01:00

28 lines
785 B
Nix

{ config, lib, pkgs, ... }:
let
cfg = config.services.xserver.gdk-pixbuf;
loadersCache = pkgs.gnome._gdkPixbufCacheBuilder_DO_NOT_USE {
extraLoaders = lib.unique (cfg.modulePackages);
};
in
{
options = {
services.xserver.gdk-pixbuf.modulePackages = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = [ ];
description = lib.mdDoc "Packages providing GDK-Pixbuf modules, for cache generation.";
};
};
# 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.
config = lib.mkIf (cfg.modulePackages != []) {
environment.variables = {
GDK_PIXBUF_MODULE_FILE = "${loadersCache}";
};
};
}