Unverified Commit 3951cf36 authored by K900's avatar K900 Committed by GitHub
Browse files

nixos/xdg/icons: add `fallbackThemes` option (#345057)

parents 56344257 ce706866
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -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 = [