2022-06-16 17:23:12 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
{
|
|
|
|
meta = {
|
|
|
|
maintainers = teams.freedesktop.members;
|
|
|
|
};
|
|
|
|
|
|
|
|
options = {
|
|
|
|
xdg.icons.enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
2022-08-12 12:06:08 +00:00
|
|
|
description = lib.mdDoc ''
|
2020-04-24 23:36:52 +00:00
|
|
|
Whether to install files to support the
|
2022-08-12 12:06:08 +00:00
|
|
|
[XDG Icon Theme specification](https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html).
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf config.xdg.icons.enable {
|
|
|
|
environment.pathsToLink = [
|
|
|
|
"/share/icons"
|
|
|
|
"/share/pixmaps"
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
environment.systemPackages = [
|
|
|
|
# Empty icon theme that contains index.theme file describing directories
|
|
|
|
# where toolkits should look for icons installed by apps.
|
|
|
|
pkgs.hicolor-icon-theme
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# libXcursor looks for cursors in XCURSOR_PATH
|
|
|
|
# it mostly follows the spec for icons
|
|
|
|
# See: https://www.x.org/releases/current/doc/man/man3/Xcursor.3.xhtml Themes
|
|
|
|
|
|
|
|
# These are preferred so they come first in the list
|
|
|
|
environment.sessionVariables.XCURSOR_PATH = [
|
|
|
|
"$HOME/.icons"
|
|
|
|
"$HOME/.local/share/icons"
|
|
|
|
];
|
|
|
|
|
|
|
|
environment.profileRelativeSessionVariables.XCURSOR_PATH = [
|
|
|
|
"/share/icons"
|
|
|
|
"/share/pixmaps"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|