1 { config, lib, pkgs, ... }:
4 maintainers = lib.teams.freedesktop.members;
8 xdg.icons.enable = lib.mkOption {
12 Whether to install files to support the
13 [XDG Icon Theme specification](https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html).
16 xdg.icons.fallbackCursorThemes = lib.mkOption {
17 type = lib.types.listOf lib.types.str;
20 Names of the fallback cursor themes, in order of preference, to be used when no other icon source can be found.
21 Set to `[]` to disable the fallback entirely.
26 config = lib.mkIf config.xdg.icons.enable {
27 environment.pathsToLink = [
32 environment.systemPackages = [
33 # Empty icon theme that contains index.theme file describing directories
34 # where toolkits should look for icons installed by apps.
35 pkgs.hicolor-icon-theme
36 ] ++ lib.optionals (config.xdg.icons.fallbackCursorThemes != []) [
38 name = "fallback-cursor-theme";
41 Inherits=${lib.concatStringsSep "," config.xdg.icons.fallbackCursorThemes}
43 destination = "/share/icons/default/index.theme";
47 # libXcursor looks for cursors in XCURSOR_PATH
48 # it mostly follows the spec for icons
49 # See: https://www.x.org/releases/current/doc/man/man3/Xcursor.3.xhtml Themes
51 # These are preferred so they come first in the list
52 environment.sessionVariables.XCURSOR_PATH = [
54 "$HOME/.local/share/icons"
57 environment.profileRelativeSessionVariables.XCURSOR_PATH = [