Mouse Cursors broke after Recent NixOS Rebuild

So, I have just done a rebuild today, on Saturday, June 9th. After doing this, my cursors have reverted back to being the default X Cursors. I was using the Catppuccin Mocha Sapphire cursors and I had them configured through a combination of the Catppuccin Nix Flake and NixOS options. Details on the flake can be found here: Catppuccin Nix Flake

Before doing this rebuild, I had this cursor working in my LightDM GTK Greeter, in my WM (xmonad via running xsetcursor -cursor_name left_ptr in xmonad’s startup hook), and in GTK apps too. Now all of these seem broken. Everything uses the default X Cursors. Heck, even running xsetcursor -cursor_name left_ptr no longer works.

My specific settings are as follows:
In configuration.nix I have the following:

services = {
  displayManager.lightdm = {
    enable = true;
    greeters.gtk = {       
    enable = true;
      cursorTheme = {
        package = pkgs.catppuccin-cursors.mochaSapphire;
        name = "Catppuccin-Mocha-Sapphire-Cursors";
        size = 48;
      };
    };
  };
};

In my home-manager config, I have the following:

catppuccin = {
  flavor = "mocha";
  accent = "sapphire";
};

gtk = {
  enable = true;
  catppuccin = {
    enable = true;
    cursor = {
      enable = true;
      flavor = "mocha";
      accent = "sapphire";
    };
  };
  cursorTheme.size = 48;
};

home.pointerCursor = {
  x11.enable = true;
  gtk.enable = true;
  package = pkgs.catppuccin-cursors.mochaSapphire;
  name = "Catppuccin-Mocha-Sapphire-Cursors";
  size = 48;
};

The same thing happened to me lately. It’s because the catppuccin-cursors theme names have all become lower case since v0.2.1:

  • All theme zips have been lowercased, matching the format in the latest releases of catppuccin/gtk.

The change is yet to be merged for catppuccin-nix, so you have to do it manually for now:

services = {
  displayManager.lightdm = {
    enable = true;
    greeters.gtk = {       
    enable = true;
      cursorTheme = {
        package = pkgs.catppuccin-cursors.mochaSapphire;
-       name = "Catppuccin-Mocha-Sapphire-Cursors";
+       name = "catppuccin-mocha-sapphire-cursors";
        size = 48;
      };
    };
  };
};
home.pointerCursor = {
  x11.enable = true;
  gtk.enable = true;
  package = pkgs.catppuccin-cursors.mochaSapphire;
- name = "Catppuccin-Mocha-Sapphire-Cursors";
+ name = "catppuccin-mocha-sapphire-cursors";
  size = 48;
};
1 Like

I’ve just made this change, but my cursors are still broken. Do I need to reboot after making this change?

Also, if I’m not misreading the source code, this line should be adding a file called catppuccin-mocha-sapphire-cursors to ~/.local/share/icons but I just don’t have such a file. All I have in there is default/ and hicolor/ https://github.com/nix-community/home-manager/blob/3d65009effd77cb0d6e7520b68b039836a7606cf/modules/config/home-cursor.nix#L161

You need to reboot for the changes to take effect since the system needs to source the XCURSOR_THEME with the correct theme, but if you’ve switched to the new build, the symlink should at least be there :thinking:

Perhaps you also need to specify the cursor in the gtk attribute:

  gtk = {
    enable = true;
    cursorTheme = {
      package = pkgs.catppuccin-cursors.mochaSapphire;
      name = "catppuccin-mocha-sapphire-cursors";
    };
  };

I already have something like that set in my home-manager config:

gtk = {
  enable = true;
  catppuccin = {
    enable = true;
    cursor = {
      enable = true;
      flavor = "mocha";
      accent = "sapphire";
    };
  };
  cursorTheme.size = 48;
};

That won’t work right now since that portion is from catppuccin-nix and the fix for the cursors hasn’t been merged there, yet: chore(home-manager): cursors are now lowercase by isabelroses · Pull Request #212 · catppuccin/nix · GitHub

For now, just outright remove it or replace it with cursorTheme:

gtk = {
  enable = true;
+ cursorTheme = {
+   package = pkgs.catppuccin-cursors.mochaSapphire;
+   name = "catppuccin-mocha-sapphire-cursors";
+ };
- catppuccin = {
-   enable = true;
-   cursor = {
-     enable = true;
-     flavor = "mocha";
-     accent = "sapphire";
-   };
- };
  cursorTheme.size = 48;
};

home.pointerCursor = {
...

Do you know what I can do about the symlinks not existing? I’ve run nixos-rebuild switch a number of times now!

Actually, applying the fix above seems to work for me. After making those changes the symlinks came back for me, for some reason. A quick reboot later and my cursors are working again.

The one thing I did need to do was keep the gtk.catppuccin.enable = true; part in, because that still sets the default system theme to “dark mode” so any applications that use the system default to determine if they should be light or dark will still work. https://github.com/catppuccin/nix/blob/0cdfa29b902976fc2941468d326325d24e148437/modules/home-manager/gtk.nix#L66

1 Like