nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 fetchgit,
5 makeWrapper,
6 meson,
7 ninja,
8 addDriverRunpath,
9 pkg-config,
10 libXcomposite,
11 libpulseaudio,
12 dbus,
13 ffmpeg,
14 wayland,
15 wayland-scanner,
16 vulkan-headers,
17 pipewire,
18 libdrm,
19 libva,
20 libglvnd,
21 libXdamage,
22 libXi,
23 libXrandr,
24 libXfixes,
25 wrapperDir ? "/run/wrappers/bin",
26 gitUpdater,
27}:
28
29stdenv.mkDerivation rec {
30 pname = "gpu-screen-recorder";
31 version = "5.12.1";
32
33 src = fetchgit {
34 url = "https://repo.dec05eba.com/${pname}";
35 tag = version;
36 hash = "sha256-FUt3R2clnWYNKgW5uo2HtON91zB2+u+Ini15/ccTJdk=";
37 };
38
39 nativeBuildInputs = [
40 pkg-config
41 makeWrapper
42 meson
43 ninja
44 ];
45
46 buildInputs = [
47 libXcomposite
48 libpulseaudio
49 dbus
50 ffmpeg
51 pipewire
52 wayland
53 wayland-scanner
54 vulkan-headers
55 libdrm
56 libva
57 libXdamage
58 libXi
59 libXrandr
60 libXfixes
61 ];
62
63 mesonFlags = [
64 # Install the upstream systemd unit
65 (lib.mesonBool "systemd" true)
66 # Enable Wayland support
67 (lib.mesonBool "portal" true)
68 # Handle by the module
69 (lib.mesonBool "capabilities" false)
70 (lib.mesonBool "nvidia_suspend_fix" false)
71 ];
72
73 postInstall = ''
74 mkdir $out/bin/.wrapped
75 mv $out/bin/gpu-screen-recorder $out/bin/.wrapped/
76 makeWrapper "$out/bin/.wrapped/gpu-screen-recorder" "$out/bin/gpu-screen-recorder" \
77 --prefix LD_LIBRARY_PATH : "${
78 lib.makeLibraryPath [
79 libglvnd
80 addDriverRunpath.driverLink
81 ]
82 }" \
83 --prefix PATH : "${wrapperDir}" \
84 --suffix PATH : "$out/bin"
85 '';
86
87 passthru.updateScript = gitUpdater { };
88
89 meta = {
90 description = "Screen recorder that has minimal impact on system performance by recording a window using the GPU only";
91 homepage = "https://git.dec05eba.com/gpu-screen-recorder/about/";
92 license = lib.licenses.gpl3Only;
93 mainProgram = "gpu-screen-recorder";
94 maintainers = with lib.maintainers; [
95 babbaj
96 js6pak
97 ];
98 platforms = [ "x86_64-linux" ];
99 };
100}