outfly/build/nix/default.nix
2024-05-12 23:16:37 +02:00

48 lines
771 B
Nix

{
rustPlatform,
pkg-config,
alsa-lib,
libcap,
libxkbcommon,
wayland,
udev,
vulkan-loader,
xorg,
lib,
}:
rustPlatform.buildRustPackage rec {
src = ../../..;
pname = "outfly";
version = "0.8.1";
cargoLock = {
lockFile = "${src}/Cargo.lock";
};
nativeBuildInputs = [ pkg-config ];
buildNoDefaultFeatures = true;
buildFeatures = [
"release_linux"
];
buildInputs = [
alsa-lib
libcap
wayland
];
postFixup =
let
runtimeDeps = [
vulkan-loader
libxkbcommon
xorg.libX11
xorg.libXrandr
xorg.libXi
xorg.libXcursor
];
libPath = lib.makeLibraryPath runtimeDeps;
in
''
patchelf $out/bin/outfly \
--add-rpath ${libPath}
'';
}