I am trying to get my school’s (development) project running that uses OpenTK, and I am at the end of my wits because I have tried everything and I’m just getting this error message, when executing dotnet run:
Unhandled exception. OpenTK.Windowing.GraphicsLibraryFramework.GLFWException: EGL: Failed to get EGL display: Success (this is thrown from OpenTKs default GLFW error handler, if you find this exception inconvenient set your own error callback using GLFWProvider.SetErrorCallback)
at OpenTK.Windowing.Desktop.GLFWProvider.DefaultErrorCallback(ErrorCode errorCode, String description)
Without including this in LD_LIBRARY_PATH it reports missing libraries.
libxkbcommon
wayland
libGL
glfw-wayland
I have read the following and beyond
Can’t seem to run graphic related
How can I resolve this libwayland-client GLFW Wayland error?
I am utterly lost
| # | @ |
|---|---|
| OS | NixOS 25.11 |
| DE | Cosmic (Wayland) |
| .Net | SDK 10 |
flake.nix
{
description = "DevShells";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system: let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
inherit (pkgs) mkShell lib;
dotnetPkg = with pkgs;
(with dotnetCorePackages; combinePackages [
sdk_10_0
]);
deps = with pkgs; [
dotnetPkg
roslyn-ls
steam-run
libxkbcommon
wayland
libGL
glfw-wayland
];
in {
devShell = mkShell {
# NIX_LD_LIBRARY_PATH = lib.makeLibraryPath ( with pkgs;[
# stdenv.cc.cc
# ] ++ deps);
# NIX_LD = "${pkgs.stdenv.cc.libc_bin}/bin/ld.so";
nativeBuildInputs = [
] ++ deps;
buildInputs = deps ++ lib.mapAttrsToList (pkgs.writeShellScriptBin) (import ./scripts.nix);
# nix-ld doesn't seem to work
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath deps;
shellHook = ''
export DOTNET_ROOT="${dotnetPkg}"
'';
};
});}