2023-12-23 00:41:35 +00:00
|
|
|
{pkgs}: let
|
|
|
|
manifest = (pkgs.lib.importTOML ./Cargo.toml).package;
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
udev
|
|
|
|
alsa-lib
|
|
|
|
vulkan-loader
|
|
|
|
vulkan-headers
|
|
|
|
vulkan-tools
|
|
|
|
vulkan-validation-layers
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXrandr # To use the x11 feature
|
|
|
|
libxkbcommon
|
|
|
|
wayland # To use the wayland feature
|
|
|
|
];
|
|
|
|
in
|
|
|
|
pkgs.rustPlatform.buildRustPackage {
|
|
|
|
inherit buildInputs;
|
|
|
|
pname = manifest.name;
|
|
|
|
version = manifest.version;
|
2023-12-21 19:00:20 +00:00
|
|
|
|
2023-12-23 00:41:35 +00:00
|
|
|
src = pkgs.lib.cleanSource ./.;
|
2023-12-21 19:00:20 +00:00
|
|
|
|
2023-12-23 00:41:35 +00:00
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
pkg-config
|
|
|
|
];
|
2023-12-21 19:00:20 +00:00
|
|
|
|
2023-12-23 00:41:35 +00:00
|
|
|
preConfigure = ''
|
|
|
|
LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath buildInputs}
|
|
|
|
'';
|
2023-12-21 19:00:20 +00:00
|
|
|
|
2023-12-23 00:41:35 +00:00
|
|
|
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
|
2023-12-21 19:00:20 +00:00
|
|
|
|
2023-12-23 00:41:35 +00:00
|
|
|
cargoBuildFlags = ["--release"];
|
|
|
|
|
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
allowBuiltinFetchGit = true;
|
|
|
|
};
|
|
|
|
}
|