Specified Rust version in Cargo.toml nix shell and builder

Development
Johannes Hendrik Gerard van der Weide 2024-01-22 14:04:39 +01:00
parent 4ea9cdf612
commit 3eae9f5896
4 changed files with 49 additions and 0 deletions

View File

@ -6,6 +6,7 @@ description = "A W.I.P. bevy-engine game "
authors = ["Johannes Hendrik Gerard van der Weide"]
version = "0.1.0"
edition = "2021"
rust-version = "1.70"
license-file = "LICENSE"
readme = "README.md"

View File

@ -41,5 +41,9 @@
devShells = forAllSystems ({ pkgs }: {
default = import ./nix/shell.nix { inherit pkgs; };
});
# Builder
packages = forAllSystems ({ pkgs }: {
default = import ./nix/default.nix { inherit pkgs; };
});
};
}

43
nix/default.nix Normal file
View File

@ -0,0 +1,43 @@
{ 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/
'';
}

View File

@ -2,6 +2,7 @@
pkgs.mkShell {
# The Nix packages provided in the environment
packages = (with pkgs; [
rust-bin.stable."1.70.0".default
# Fluff
cargo-mommy
onefetch