From 685825fb07a378770ae23cb97897aebde3f91bb5 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 4 Nov 2024 20:36:49 -0500 Subject: [PATCH] fix(gsr): separate binaries to fix cap problem --- devices/binto/modules/gpu-replay.nix | 10 ++++------ packages/gpu-screen-recorder/default.nix | 9 +++++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/devices/binto/modules/gpu-replay.nix b/devices/binto/modules/gpu-replay.nix index 23095464..e98376c2 100644 --- a/devices/binto/modules/gpu-replay.nix +++ b/devices/binto/modules/gpu-replay.nix @@ -11,7 +11,7 @@ cfgDesktop = config.roles.desktop; - gsr = self.packages.${pkgs.system}.gpu-screen-recorder; + pkg = self.packages.${pkgs.system}.gpu-screen-recorder; hyprPkgs = config.home-manager.users.${mainUser}.wayland.windowManager.hyprland.finalPackage; in { security.wrappers = { @@ -19,21 +19,19 @@ in { owner = "root"; group = "video"; capabilities = "cap_sys_nice+ep"; - source = "${gsr}/bin/gpu-screen-recorder"; + source = "${pkg.gsr}/bin/gpu-screen-recorder"; }; gsr-kms-server = { owner = "root"; group = "video"; capabilities = "cap_sys_admin+ep"; - source = "${gsr}/bin/gsr-kms-server"; + source = "${pkg.kms}/bin/gsr-kms-server"; }; }; home-manager.users.${mainUser} = { home.packages = [ - gsr - (pkgs.writeShellApplication { name = "gpu-save-replay"; runtimeInputs = [pkgs.procps]; @@ -55,7 +53,7 @@ in { gpu-screen-recorder ${concatStringsSep " " [ ''-v no'' ''-r 1200'' - ''-mf yes'' + ''-df yes'' ''-o /home/matt/Videos/Replay'' # Audio settings ''-ac aac'' diff --git a/packages/gpu-screen-recorder/default.nix b/packages/gpu-screen-recorder/default.nix index 7ad48347..983ecbf8 100644 --- a/packages/gpu-screen-recorder/default.nix +++ b/packages/gpu-screen-recorder/default.nix @@ -69,8 +69,17 @@ in libglvnd ] }" + + # This is needed to force gsr to lookup kms in PATH + # to get the security wrapper + mkdir -p $gsr $kms/bin + cp -r $out/bin $gsr + mv $gsr/bin/gsr-kms-server $kms/bin + rm $out/bin/gsr-kms-server ''; + outputs = ["out" "gsr" "kms"]; + 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/";