2025-08-12 22:16:37 +00:00

101 lines
2.0 KiB
Nix

{
stdenv,
lib,
fetchgit,
makeWrapper,
meson,
ninja,
addDriverRunpath,
pkg-config,
libXcomposite,
libpulseaudio,
dbus,
ffmpeg,
wayland,
wayland-scanner,
vulkan-headers,
pipewire,
libdrm,
libva,
libglvnd,
libXdamage,
libXi,
libXrandr,
libXfixes,
wrapperDir ? "/run/wrappers/bin",
gitUpdater,
}:
stdenv.mkDerivation rec {
pname = "gpu-screen-recorder";
version = "5.6.5";
src = fetchgit {
url = "https://repo.dec05eba.com/${pname}";
tag = version;
hash = "sha256-2tlhuJ2Ro2ExIXVO8dUiR749el/R3l9nl6ezShF19Fg=";
};
nativeBuildInputs = [
pkg-config
makeWrapper
meson
ninja
];
buildInputs = [
libXcomposite
libpulseaudio
dbus
ffmpeg
pipewire
wayland
wayland-scanner
vulkan-headers
libdrm
libva
libXdamage
libXi
libXrandr
libXfixes
];
mesonFlags = [
# Install the upstream systemd unit
(lib.mesonBool "systemd" true)
# Enable Wayland support
(lib.mesonBool "portal" true)
# Handle by the module
(lib.mesonBool "capabilities" false)
(lib.mesonBool "nvidia_suspend_fix" false)
];
postInstall = ''
mkdir $out/bin/.wrapped
mv $out/bin/gpu-screen-recorder $out/bin/.wrapped/
makeWrapper "$out/bin/.wrapped/gpu-screen-recorder" "$out/bin/gpu-screen-recorder" \
--prefix LD_LIBRARY_PATH : "${
lib.makeLibraryPath [
libglvnd
addDriverRunpath.driverLink
]
}" \
--prefix PATH : "${wrapperDir}" \
--suffix PATH : "$out/bin"
'';
passthru.updateScript = gitUpdater { };
meta = {
description = "Screen recorder that has minimal impact on system performance by recording a window using the GPU only";
homepage = "https://git.dec05eba.com/gpu-screen-recorder/about/";
license = lib.licenses.gpl3Only;
mainProgram = "gpu-screen-recorder";
maintainers = with lib.maintainers; [
babbaj
js6pak
];
platforms = [ "x86_64-linux" ];
};
}