codebam
January 30, 2025, 10:59am
1
Hey, I’m trying to start learning Vulkan and I’m using ash .
This is the devshell I’m using. flake.nix:
{
inputs = {
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
cargo
vulkan-loader
];
};
}
);
}
The examples build with this, but I get this error when I try to start the binary.
Error: Os(OsError { line: 80, file: "/home/codebam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.15/src/platform_impl/linux/wayland/event_loop/mod.rs", error: WaylandError(Connection(NoWaylandLib)) })
What do I need to change in my flake.nix so winit can find libwayland?
codebam
January 30, 2025, 11:04am
2
Okay so I figured it out, another error now.
New flake.nix:
{
inputs = {
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
cargo
vulkan-loader
];
LD_LIBRARY_PATH="${pkgs.wayland}/lib";
};
}
);
}
New error:
thread 'main' panicked at /home/codebam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.15/src/platform_impl/linux/wayland/seat/keyboard/mod.rs:315:41:
called `Result::unwrap()` on an `Err` value: XKBNotFound
codebam
January 30, 2025, 11:24am
3
{
inputs = {
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
cargo
vulkan-loader
];
LD_LIBRARY_PATH="${pkgs.wayland}/lib:${pkgs.libxkbcommon}/lib:${pkgs.vulkan-loader}/lib:${pkgs.vulkan-validation-layers}/lib";
VK_LAYER_PATH = "${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d";
};
}
);
}