-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
95 lines (94 loc) · 2.58 KB
/
Copy pathflake.nix
File metadata and controls
95 lines (94 loc) · 2.58 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
nixpkgs,
nixpkgs-unstable,
fenix,
...
}: let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in {
devShells = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
unstable = nixpkgs-unstable.legacyPackages.${system};
inherit (pkgs.stdenv) isLinux;
rustToolchain = fenix.packages.${system}.stable.withComponents [
"cargo"
"clippy"
"rustfmt"
"rust-src"
"rustc"
"rust-analyzer"
];
webkitWithWebRTC = pkgs.webkitgtk_4_1.override {enableExperimental = true;};
gstPlugins = with pkgs.gst_all_1; [
gstreamer
gst-plugins-base
gst-plugins-good
gst-plugins-bad
gst-plugins-ugly
gst-libav
gst-plugins-rs
];
# libnice provides webrtcbin's ICE agent; its plugin is in the `out` output.
gstPluginPath =
pkgs.lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" gstPlugins
+ ":${pkgs.libnice.out}/lib/gstreamer-1.0";
linuxLibs = with pkgs; [
glib
gtk3
cairo
pango
gdk-pixbuf
atk
webkitWithWebRTC
libsoup_3
dbus
openssl
librsvg
SDL2
];
in {
default = pkgs.mkShell {
nativeBuildInputs =
[pkgs.pkg-config]
++ pkgs.lib.optionals isLinux [pkgs.wrapGAppsHook3];
buildInputs =
(with pkgs; [
rustToolchain
cmake
pkg-config
unstable.bun
ffmpeg
python3
])
++ pkgs.lib.optionals isLinux linuxLibs;
CMAKE_POLICY_VERSION_MINIMUM = "3.5";
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
BINDGEN_EXTRA_CLANG_ARGS = pkgs.lib.optionalString isLinux (
builtins.concatStringsSep " " [
"-isystem ${pkgs.glibc.dev}/include"
"-isystem ${pkgs.libclang.lib}/lib/clang/${pkgs.lib.versions.major pkgs.libclang.version}/include"
]
);
env =
pkgs.lib.optionalAttrs isLinux {
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath ([pkgs.ffmpeg] ++ linuxLibs);
GST_PLUGIN_SYSTEM_PATH_1_0 = gstPluginPath;
};
};
});
};
}