-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
70 lines (70 loc) · 1.83 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, nixpkgs, flake-utils, rust-overlay, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
rustVersion = pkgs.rust-bin.stable.latest.default;
rustPlatform = pkgs.makeRustPlatform {
cargo = rustVersion;
rustc = rustVersion;
};
myRustBuild = rustPlatform.buildRustPackage {
pname =
"game123"; # make this what ever your cargo.toml package.name is
version = "0.1.0";
src = ./.; # the folder with the cargo.toml
cargoLock.lockFile = ./Cargo.lock;
buildInputs = with pkgs; [
SDL2
cmake
alsaLib
];
nativeBuildInputs = with pkgs; [
SDL2
cmake
alsaLib
pkg-config
];
postInstall = ''
cp -r assets $out/assets
'';
};
in {
defaultPackage = myRustBuild;
devShell = pkgs.mkShell {
LD_LIBRARY_PATH = builtins.concatStringsSep ":" [
"${pkgs.xorg.libX11}/lib"
"${pkgs.xorg.libXi}/lib"
"${pkgs.libGL}/lib"
"${pkgs.wayland}/lib"
"${pkgs.libxkbcommon}/lib"
];
buildInputs = with pkgs; [
(rustVersion.override { extensions = [ "rust-src" "rust-analyzer" ]; })
gdb
linuxPackages.perf
cargo-flamegraph
alsaLib
grafx2
cmake
freetype
expat
openssl
pkg-config
fontconfig
vulkan-validation-layers
rust-analyzer
SDL2
cmake
alsaLib
wayland
egl-wayland
];
};
});
}