-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
70 lines (68 loc) · 1.92 KB
/
flake.nix
File metadata and controls
70 lines (68 loc) · 1.92 KB
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
{
description = "bevy + gstreamer development environment";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, fenix, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
rust-toolchain = fenix.packages.${system}.fromToolchainFile {
file = ./rust-toolchain.toml;
sha256 = "sha256-SJwZ8g0zF2WrKDVmHrVG3pD2RGoQeo24MEXnNx5FyuI=";
};
buildInputs = with pkgs; lib.lists.flatten [
# for bevy
systemd # libudev
alsa-lib # libasound
## x11
(with xorg; [
libX11 libXcursor libXi libxcb
])
libxkbcommon
## gpu
vulkan-loader
glfw
wayland
libGL
libGLU
# for gstreamer
gcc14Stdenv.cc.cc.lib # workaround to avoid GLIBC version mismatch
(with gst_all_1; [
glib
gstreamer # Tools like "gst-inspect", "gst-launch", etc.
gst-plugins-base # Common plugins like "filesrc".
gst-plugins-good # Specialized plugins separated by quality.
gst-plugins-bad
gst-plugins-ugly
gst-libav # Plugin to reuse ffmpeg to play almost every video format.
gst-vaapi # Plugin to Support the Video Audio (Hardware) Acceleration API.
])
];
in with pkgs;{
apps.rust-analyzer = {
type = "app";
program = "${rust-toolchain}/bin/rust-analyzer";
};
devShell = mkShell.override { stdenv = gcc14Stdenv; } {
# dev dependencies
inherit buildInputs;
LD_LIBRARY_PATH = "$LD_LIBRARY_PATH:${
lib.makeLibraryPath buildInputs
}";
# build tools
nativeBuildInputs = [
pkg-config
rust-toolchain
];
# dev tools
packages = [
];
};
});
}