mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
33 lines
877 B
Nix
33 lines
877 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
cfg = config.programs.gdk-pixbuf;
|
|
|
|
loadersCache = pkgs.gnome._gdkPixbufCacheBuilder_DO_NOT_USE {
|
|
extraLoaders = lib.unique cfg.modulePackages;
|
|
};
|
|
in
|
|
|
|
{
|
|
imports = [
|
|
(lib.mkRenamedOptionModule [ "services" "xserver" "gdk-pixbuf" ] [ "programs" "gdk-pixbuf" ])
|
|
];
|
|
|
|
options = {
|
|
programs.gdk-pixbuf.modulePackages = lib.mkOption {
|
|
type = lib.types.listOf lib.types.package;
|
|
default = [ ];
|
|
description = "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.sessionVariables = {
|
|
GDK_PIXBUF_MODULE_FILE = loadersCache;
|
|
};
|
|
};
|
|
}
|