Skip to content

Commit ce70686

Browse files
committed
nixos/xdg/icons: add fallbackThemes option
1 parent e911628 commit ce70686

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

nixos/modules/config/xdg/icons.nix

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@
1313
[XDG Icon Theme specification](https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html).
1414
'';
1515
};
16+
xdg.icons.fallbackCursorThemes = lib.mkOption {
17+
type = lib.types.listOf lib.types.str;
18+
default = [];
19+
description = ''
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.
22+
'';
23+
};
1624
};
1725

1826
config = lib.mkIf config.xdg.icons.enable {
@@ -25,6 +33,15 @@
2533
# Empty icon theme that contains index.theme file describing directories
2634
# where toolkits should look for icons installed by apps.
2735
pkgs.hicolor-icon-theme
36+
] ++ lib.optionals (config.xdg.icons.fallbackCursorThemes != []) [
37+
(pkgs.writeTextFile {
38+
name = "fallback-cursor-theme";
39+
text = ''
40+
[Icon Theme]
41+
Inherits=${lib.concatStringsSep "," config.xdg.icons.fallbackCursorThemes}
42+
'';
43+
destination = "/share/icons/default/index.theme";
44+
})
2845
];
2946

3047
# libXcursor looks for cursors in XCURSOR_PATH

nixos/modules/services/desktop-managers/plasma6.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ in {
245245
systemd.services."drkonqi-coredump-processor@".wantedBy = ["[email protected]"];
246246

247247
xdg.icons.enable = true;
248+
xdg.icons.fallbackCursorThemes = mkDefault ["breeze_cursors"];
248249

249250
xdg.portal.enable = true;
250251
xdg.portal.extraPortals = [

0 commit comments

Comments
 (0)