diff --git a/nixos/modules/config/xdg/icons.nix b/nixos/modules/config/xdg/icons.nix index 9e2b3c2e46e0..b0267d21d3eb 100644 --- a/nixos/modules/config/xdg/icons.nix +++ b/nixos/modules/config/xdg/icons.nix @@ -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 diff --git a/nixos/modules/services/desktop-managers/plasma6.nix b/nixos/modules/services/desktop-managers/plasma6.nix index 6056ff99e3cc..f5018c4c29ef 100644 --- a/nixos/modules/services/desktop-managers/plasma6.nix +++ b/nixos/modules/services/desktop-managers/plasma6.nix @@ -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 = [