forked from Mad-Star-Studio/Starlight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
53 lines (47 loc) · 1.38 KB
/
default.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
{ pkgs ? import <nixpkgs> { }
, stdenv ? pkgs.stdenv
, lib ? stdenv.lib
# A set providing `buildRustPackage :: attrsets -> derivation`
, rustPlatform ? pkgs.rustPlatform
, fetchFromGitHub ? pkgs.fetchFromGitHub
, gitignoreSrc ? null
, pkgconfig ? pkgs.pkgconfig
, gtk3 ? pkgs.gtk3
, glib ? pkgs.glib
, gobject-introspection ? pkgs.gobject-introspection
}:
let
gitignoreSource =
if gitignoreSrc != null
then gitignoreSrc.gitignoreSource
else (import (fetchFromGitHub {
owner = "hercules-ci";
repo = "gitignore";
rev = "c4662e662462e7bf3c2a968483478a665d00e717";
sha256 = "0jx2x49p438ap6psy8513mc1nnpinmhm8ps0a4ngfms9jmvwrlbi";
}) { inherit lib; }).gitignoreSource;
in
rustPlatform.buildRustPackage rec {
pname = "starlight_engine";
version = "0.0.1";
src = gitignoreSource ./.;
buildInputs = with pkgs; [
udev alsa-lib vulkan-loader
xorg.libX11 xorg.libXcursor xorg.libXi xorg.libXrandr # To use the x11 feature
libxkbcommon wayland # To use the wayland feature
renderdoc
];
nativeBuildInputs = with pkgs; [ pkg-config ];
cargoLock = {
lockFile = ./Cargo.lock;
allowBuiltinFetchGit = true;
};
shellHook = ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${builtins.toString (pkgs.lib.makeLibraryPath buildInputs)}";
'';
meta = with stdenv.lib; {
homepage = "";
description = "";
license = "MIT License";
};
}