-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
40 lines (35 loc) · 1.29 KB
/
Copy pathflake.nix
File metadata and controls
40 lines (35 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{
description = "Wayland devshell (fixes NoWaylandLib)";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
# Libraries that Wayland/winit/wgpu binaries dlopen() at runtime.
# wayland-client doesn't link libwayland-client.so — it loads it
# dynamically, so it must be on LD_LIBRARY_PATH or you get NoWaylandLib.
runtimeLibs = with pkgs; [
wayland # libwayland-client.so.0 <- the NoWaylandLib culprit
libxkbcommon # keyboard input
libGL # OpenGL
vulkan-loader # Vulkan / wgpu / ash
# winit also dlopens the X11 libs (for its X11 backend):
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
];
in {
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
pkg-config
];
buildInputs = runtimeLibs;
# The fix: make those dlopen()'d .so files findable at runtime.
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath runtimeLibs;
};
});
}