add shadowplay (basically)

This commit is contained in:
Kopatz
2025-05-27 18:09:53 +02:00
parent b5d7cf933c
commit e2f799314f
6 changed files with 210 additions and 0 deletions

View File

@@ -13,4 +13,6 @@
mangal-patched = pkgs.callPackage ./mangal/default.nix { };
rdna4-lact = pkgs.callPackage ./lact/default.nix { };
csharp-ls-8 = pkgs.callPackage ./csharp-lsp/default.nix { };
gpu-screen-recorder-ui = pkgs.callPackage ./gpu-screen-recorder-ui/default.nix { };
gpu-screen-recorder-notification = pkgs.callPackage ./gpu-screen-recorder-notification/default.nix { };
}

View File

@@ -0,0 +1,61 @@
{ lib
, stdenv
, fetchgit
, pkg-config
, meson
, ninja
, libX11
, libXrender
, libXrandr
, libXext
, libglvnd
, wayland
, wayland-scanner
, gitUpdater
,
}:
stdenv.mkDerivation rec {
pname = "gpu-screen-recorder-notification";
version = "1.0.7";
src = fetchgit {
url = "https://repo.dec05eba.com/${pname}";
tag = version;
hash = "sha256-hdsbQewnqSJvWEW9HaFuVf6vDAY5CDCGxVFsxZJ4Yh8=";
};
postPatch = ''
substituteInPlace depends/mglpp/depends/mgl/src/gl.c \
--replace-fail "libGL.so.1" "${lib.getLib libglvnd}/lib/libGL.so.1" \
--replace-fail "libGLX.so.0" "${lib.getLib libglvnd}/lib/libGLX.so.0" \
--replace-fail "libEGL.so.1" "${lib.getLib libglvnd}/lib/libEGL.so.1"
'';
nativeBuildInputs = [
pkg-config
meson
ninja
];
buildInputs = [
libX11
libXrender
libXrandr
libXext
libglvnd
wayland
wayland-scanner
];
passthru.updateScript = gitUpdater { };
meta = {
description = "Notification in the style of ShadowPlay";
homepage = "https://git.dec05eba.com/${pname}/about/";
license = lib.licenses.gpl3Only;
mainProgram = "gsr-notify";
maintainers = with lib.maintainers; [ js6pak ];
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,99 @@
{
lib,
stdenv,
fetchgit,
pkg-config,
meson,
ninja,
makeWrapper,
gpu-screen-recorder,
gpu-screen-recorder-notification,
libX11,
libXrender,
libXrandr,
libXcomposite,
libXi,
libXcursor,
libglvnd,
libpulseaudio,
libdrm,
wayland,
wayland-scanner,
wrapperDir ? "/run/wrappers/bin",
gitUpdater,
}:
stdenv.mkDerivation rec {
pname = "gpu-screen-recorder-ui";
version = "1.6.1";
src = fetchgit {
url = "https://repo.dec05eba.com/${pname}";
tag = version;
hash = "sha256-HKUbxX6EXLR4N/ag7gLIqitxBRU+1aLtlqDiSS7LK5I=";
};
postPatch = ''
substituteInPlace depends/mglpp/depends/mgl/src/gl.c \
--replace-fail "libGL.so.1" "${lib.getLib libglvnd}/lib/libGL.so.1" \
--replace-fail "libGLX.so.0" "${lib.getLib libglvnd}/lib/libGLX.so.0" \
--replace-fail "libEGL.so.1" "${lib.getLib libglvnd}/lib/libEGL.so.1"
substituteInPlace extra/gpu-screen-recorder-ui.service \
--replace-fail "ExecStart=${meta.mainProgram}" "ExecStart=$out/bin/${meta.mainProgram}"
'';
nativeBuildInputs = [
pkg-config
meson
ninja
makeWrapper
];
buildInputs = [
libX11
libXrender
libXrandr
libXcomposite
libXi
libXcursor
libglvnd
libpulseaudio
libdrm
wayland
wayland-scanner
];
mesonFlags = [
# Handled by the module
(lib.mesonBool "capabilities" false)
];
postInstall =
let
gpu-screen-recorder-wrapped = gpu-screen-recorder.override {
inherit wrapperDir;
};
in
''
wrapProgram "$out/bin/${meta.mainProgram}" \
--prefix PATH : "${wrapperDir}" \
--suffix PATH : "${
lib.makeBinPath [
gpu-screen-recorder-wrapped
gpu-screen-recorder-notification
]
}"
'';
passthru.updateScript = gitUpdater { };
meta = {
description = "Fullscreen overlay UI for GPU Screen Recorder in the style of ShadowPlay";
homepage = "https://git.dec05eba.com/${pname}/about/";
license = lib.licenses.gpl3Only;
mainProgram = "gsr-ui";
maintainers = with lib.maintainers; [ js6pak ];
platforms = lib.platforms.linux;
};
}