Fixing broken cursors on NixOS

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


Nice gallery btw.

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

I have so few posts, it never occurred to me that anyone would need to filter them :joy: I’ve now added tags though, you can find Nix-only posts at nixos - david’s assorted web pages

1 Like

Regarding your workaround for “Too many rebuilds” You could simply override only xterm from the start with:

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/", RTLD_LAZY);
           /* Init the Toolkit. */

And use in environment.systemPackages.

Thanks for investigating this issue!

1 Like

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.


Added to the list

I had to move them to landscape