Cannot launch kitty terminal Failed to create GLFWwindow

full log:

$ kitty

[0.167] [glfw error 65542]: EGL: Failed to get EGL display: Success
[0.179] Traceback (most recent call last):
  File "/nix/store/2x0qa05yfmr8a0xgnz5bxk0m4syfk6mv-kitty-0.34.1/bin/../lib/kitty/kitty/main.py", line 562, in main
    _main()
  File "/nix/store/2x0qa05yfmr8a0xgnz5bxk0m4syfk6mv-kitty-0.34.1/bin/../lib/kitty/kitty/main.py", line 554, in _main
    run_app(opts, cli_opts, bad_lines)
  File "/nix/store/2x0qa05yfmr8a0xgnz5bxk0m4syfk6mv-kitty-0.34.1/bin/../lib/kitty/kitty/main.py", line 297, in __call__
    _run_app(opts, args, bad_lines)
  File "/nix/store/2x0qa05yfmr8a0xgnz5bxk0m4syfk6mv-kitty-0.34.1/bin/../lib/kitty/kitty/main.py", line 268, in _run_app
    window_id = create_os_window(
                ^^^^^^^^^^^^^^^^^
ValueError: Failed to create GLFWwindow

is there anyone with the same issue? The only thing I could think of is that i have mesa driver from hyprland’s flake input but if i remove them hyprland would not launch:

 # https://wiki.hyprland.org/Nix/Hyprland-on-NixOS/
hardware.opengl = {
    package = inputs.hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}.mesa.drivers;
    # if you also want 32-bit support (e.g for Steam)
    driSupport32Bit = true;
    package32 = inputs.hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}.pkgsi686Linux.mesa.drivers;
  };

I just had this exact problem. I have solved it for now by changing my hyprland flake to follow nixpkgs, like so:

  inputs.hyprland = {
    url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
    inputs.nixpkgs.follows = "nixpkgs";
  };

I figure the problem was that the mesa libraries from hyprland mismatching the nixpkgs ones meant that kitty (and others) wouldn’t load properly.

The problem with this solution, however, is that it means that the hyprland cachix doesn’t have a cache hit anymore, and you have to wait for it to compile everything from scratch.

yep, i refused to wait hours to build hyprland so i just went with upgrading to unstable nixpkgs, and it apparently fixed my audio issue i’m having too.

I’ll take this as a win

What if I’m not using the flake? I’m using hyprland through the homemanager package.
I have hm following nixpkgs unstable so not sure what’s going on.

This setup used to work fine until I updated.