RustThingy/nix/default.nix

44 lines
801 B
Nix

{ pkgs ? import <nixpkgs> {} }:
pkgs.rustPlatform.buildRustPackage {
pname = "hertog-game";
version = "0.1.0";
src = ../.;
cargoLock = {
lockFile = ../Cargo.lock;
};
nativeBuildInputs = with pkgs; [
rust-bin.stable."1.70.0".default
makeWrapper
pkg-config
] ++ lib.optionals stdenv.isLinux [
vulkan-loader
];
buildInputs = with pkgs; [
] ++ lib.optionals stdenv.isLinux [
alsa-lib
libxkbcommon
udev
vulkan-loader
wayland
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk_11_0.frameworks.Cocoa
rustPlatform.bindgenHook
];
postInstall = ''
mkdir $out/bin/assets
mkdir $out/bin/data
cp -r assets $out/bin/
cp -r data $out/bin/
'';
}