# Fixing broken cursors on NixOS

**URL:** https://discourse.nixos.org/t/fixing-broken-cursors-on-nixos/38769
**Category:** Links
**Created:** [January 25, 2024, 8:48am UTC](https://discourse.nixos.org/t/fixing-broken-cursors-on-nixos/38769 "2024-01-25T08:48:03Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![dnr](https://discourse.nixos.org/user_avatar/discourse.nixos.org/dnr/32/3205_2.png) [@dnr](https://discourse.nixos.org/u/dnr)
#### Post date: [January 25, 2024, 8:48am UTC](https://discourse.nixos.org/t/fixing-broken-cursors-on-nixos/38769/1 "2024-01-25T08:48:03Z")

</div>

I wrote a blog post about how I fixed broken cursors in apps like xterm. Hopefully someone else will find it useful.

> **[Broken Cursors in NixOS](https://dnr.im/tech/broken-cursors/)**
>
> When I migrated all my systems from Ubuntu to NixOS a few years ago, I kept a list of all the discrepancies I found and tried to fix them one by one. The last one on the list was wrong cursor sizes in some apps. I tried everything I could find but...

---

<div class="post-metadata">

### Author: ![hugosenari](https://discourse.nixos.org/user_avatar/discourse.nixos.org/hugosenari/32/5630_2.png) [@hugosenari](https://discourse.nixos.org/u/hugosenari)
#### Post date: [January 26, 2024, 5:54am UTC](https://discourse.nixos.org/t/fixing-broken-cursors-on-nixos/38769/2 "2024-01-26T05:54:48Z")

</div>

Nice gallery btw.

There are any change of adding tags (to filter all nix related content) to your posts?

---

<div class="post-metadata">

### Author: ![dnr](https://discourse.nixos.org/user_avatar/discourse.nixos.org/dnr/32/3205_2.png) [@dnr](https://discourse.nixos.org/u/dnr)
#### Post date: [January 30, 2024, 4:41am UTC](https://discourse.nixos.org/t/fixing-broken-cursors-on-nixos/38769/3 "2024-01-30T04:41:07Z")

</div>

I have so few posts, it never occurred to me that anyone would need to filter them 😂 I’ve now added tags though, you can find Nix-only posts at [nixos - david’s assorted web pages](https://dnr.im/tags/nixos/)

---

<div class="post-metadata">

### Author: ![doronbehar](https://discourse.nixos.org/user_avatar/discourse.nixos.org/doronbehar/32/1387_2.png) [@doronbehar](https://discourse.nixos.org/u/doronbehar)
#### Post date: [January 30, 2024, 7:01am UTC](https://discourse.nixos.org/t/fixing-broken-cursors-on-nixos/38769/4 "2024-01-30T07:01:15Z")

</div>

Regarding your workaround for [“Too many rebuilds”](https://dnr.im/tech/broken-cursors/#too-many-rebuilds) You could simply override only xterm from the start with:

```nix
final: prev: {
my-xterm = prev.xterm.overrideAttrs (old: {
  patches = old.patches ++ [
    (final.writeText "xterm-load-xcursor.patch" ''
      --- a/main.c
      +++ b/main.c
      @@ -94,4 +94,5 @@
       #include <graphics.h>

      +#include <dlfcn.h>
       #if OPT_TOOLBAR

      @@ -2510,4 +2512,6 @@ main(int argc, char *argv[]ENVP_ARG)
       #endif /* } TERMIO_STRUCT */

      + // dlopen once here so it's cached when libX11 tries to dlopen it
      + dlopen("${final.xorg.libXcursor}/lib/libXcursor.so.1", RTLD_LAZY);
           /* Init the Toolkit. */
           {
      '')
  ];
});
}

```

And use `pkgs.my-xterm` in `environment.systemPackages`.

Thanks for investigating this issue!

---

<div class="post-metadata">

### Author: ![dnr](https://discourse.nixos.org/user_avatar/discourse.nixos.org/dnr/32/3205_2.png) [@dnr](https://discourse.nixos.org/u/dnr)
#### Post date: [January 30, 2024, 7:51am UTC](https://discourse.nixos.org/t/fixing-broken-cursors-on-nixos/38769/5 "2024-01-30T07:51:03Z")

</div>

True, but my window manager (notion) has a direct dependency on xterm, and I wanted that to point to the right one. I guess I could explicitly override that one also, of course.

---

<div class="post-metadata">

### Author: ![hugosenari](https://discourse.nixos.org/user_avatar/discourse.nixos.org/hugosenari/32/5630_2.png) [@hugosenari](https://discourse.nixos.org/u/hugosenari)
#### Post date: [February 7, 2024, 3:16am UTC](https://discourse.nixos.org/t/fixing-broken-cursors-on-nixos/38769/6 "2024-02-07T03:16:48Z")

</div>

Thanks,

Added to the list  
[https://coggle.it/diagram/Y9k9VVmUw-1okyFh/t/nix-language/6308e4b6557222319df898379a8ecb073fe18b3647745866b12ca882e5919cd2](https://coggle.it/diagram/Y9k9VVmUw-1okyFh/t/nix-language/6308e4b6557222319df898379a8ecb073fe18b3647745866b12ca882e5919cd2)

I had to move them to [landscape](http://nixos.land/)
