nixos/xdg/icons: add fallbackThemes option
This commit is contained in:
@@ -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 = [
|
||||
|
||||
Reference in New Issue
Block a user