update flake structure and update default.nix for production.

This commit is contained in:
2025-11-13 23:42:39 +01:00
parent 830075116a
commit d13a7b4f96
3 changed files with 63 additions and 18 deletions

View File

@@ -1,21 +1,50 @@
{
# lib,
lib,
rustPlatform,
packageName,
makeWrapper,
pkg-config,
wayland,
alsa-lib,
libudev-zero,
udev,
libxkbcommon,
vulkan-loader,
}:
rustPlatform.buildRustPackage {
name = "${packageName}";
name = "war-in-tunnels";
src = ./.;
buildInputs = [
wayland
alsa-lib
libudev-zero
udev
libxkbcommon
vulkan-loader
];
nativeBuildInputs = [
makeWrapper
pkg-config
];
nativeBuildInputs = [ pkg-config ];
# cargoHash = lib.fakeHash;
cargoHash = "sha256-ZJ7DODvIiupVlmBUhQhXEVlNeDT0S62z/5Qln77JpQc=";
cargoBuildFlags = [
"--bin"
"war-in-tunnels"
];
postInstall = ''
mkdir $out/share
ls
cp -r assets $out/share
wrapProgram $out/bin/war-in-tunnels --chdir $out/share
'';
postFixup = ''
patchelf $out/bin/.war-in-tunnels-wrapped \
--add-rpath ${
lib.makeLibraryPath [
vulkan-loader
libxkbcommon
]
}
'';
env = {
ZSTD_SYS_USE_PKG_CONFIG = true;
};
}