nixos/xdg/icons: add fallbackThemes option

This commit is contained in:
K900
2024-09-29 08:42:20 +03:00
parent e9116281e1
commit ce7068660a
2 changed files with 18 additions and 0 deletions
+17
View File
@@ -13,6 +13,14 @@
[XDG Icon Theme specification](https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html).
'';
};
xdg.icons.fallbackCursorThemes = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
description = ''
Names of the fallback cursor themes, in order of preference, to be used when no other icon source can be found.
Set to `[]` to disable the fallback entirely.
'';
};
};
config = lib.mkIf config.xdg.icons.enable {
@@ -25,6 +33,15 @@
# Empty icon theme that contains index.theme file describing directories
# where toolkits should look for icons installed by apps.
pkgs.hicolor-icon-theme
] ++ lib.optionals (config.xdg.icons.fallbackCursorThemes != []) [
(pkgs.writeTextFile {
name = "fallback-cursor-theme";
text = ''
[Icon Theme]
Inherits=${lib.concatStringsSep "," config.xdg.icons.fallbackCursorThemes}
'';
destination = "/share/icons/default/index.theme";
})
];
# libXcursor looks for cursors in XCURSOR_PATH
@@ -245,6 +245,7 @@ in {
systemd.services."drkonqi-coredump-processor@".wantedBy = ["systemd-coredump@.service"];
xdg.icons.enable = true;
xdg.icons.fallbackCursorThemes = mkDefault ["breeze_cursors"];
xdg.portal.enable = true;
xdg.portal.extraPortals = [