refactor(gsr): clean up deriv and remove path warning
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2025-02-11 12:30:42 -05:00
parent f68fcce055
commit 2c070a4be0
3 changed files with 18 additions and 9 deletions

View file

@ -11,7 +11,7 @@ in {
package =
(pkgs.searxng.override {
# FIXME: https://github.com/NixOS/nixpkgs/issues/380351
# FIXME: https://pr-tracker.nelim.org/?pr=381174
python3 = pkgs.python3.override {
packageOverrides = pyFinal: pyPrev: {
httpx = pyPrev.httpx.overridePythonAttrs (o: rec {

View file

@ -1,6 +1,10 @@
{
lib,
# Params
pname,
gpu-screen-recorder-src,
isKmsServer ? false,
# Derivation deps
lib,
addDriverRunpath,
dbus,
ffmpeg,
@ -17,7 +21,6 @@
vulkan-headers,
wayland,
xorg,
pname,
...
}: let
inherit (lib) makeLibraryPath;
@ -34,6 +37,11 @@ in
src = gpu-screen-recorder-src;
# Get rid of useless warning
postPatch = ''
sed -i 's/.*gsr-kms-server is not installed in the same directory.*//' ./kms/client/kms_client.c
'';
nativeBuildInputs = [
pkg-config
makeWrapper
@ -79,17 +87,17 @@ in
# This is needed to force gsr to lookup kms in PATH
# to get the security wrapper
postFixup =
if pname == "gpu-screen-recorder"
if isKmsServer
then
# bash
''
rm $out/bin/gsr-kms-server
''
else
# bash
''
rm $out/bin/gpu-screen-recorder
rm $out/bin/.gpu-screen-recorder-wrapped
''
else
# bash
''
rm $out/bin/gsr-kms-server
'';
meta = {

View file

@ -5,5 +5,6 @@
}:
callPackage ./generic.nix {
pname = "gsr-kms-server";
isKmsServer = true;
inherit gpu-screen-recorder-src;
}