Skip to content

gpu-screen-recorder-ui: init at 1.10.8#369574

Open
js6pak wants to merge 3 commits intoNixOS:masterfrom
js6pak:gpu-screen-recorder-ui/init
Open

gpu-screen-recorder-ui: init at 1.10.8#369574
js6pak wants to merge 3 commits intoNixOS:masterfrom
js6pak:gpu-screen-recorder-ui/init

Conversation

@js6pak
Copy link
Member

@js6pak js6pak commented Dec 31, 2024

https://git.dec05eba.com/gpu-screen-recorder-ui/about/
Fullscreen overlay UI for GPU Screen Recorder in the style of ShadowPlay

Closes #369558
Depends on #367552

Usage

  1. Enable the module to add the setcap wrappers and systemd service
programs.gpu-screen-recorder-ui.enable = true;
  1. Start the program using one of the following ways:
    1. Run gsr-ui
    2. Enable the service imperatively systemctl enable --now --user gpu-screen-recorder-ui
    3. Enable the service declaratively
      systemd.user.services.gpu-screen-recorder-ui.wantedBy = [ "default.target" ];
      Note: This will break the "Startup" setting in-app
      Question: Should this be a nixos module option?
  2. Press Alt+Z (key binds are not configurable yet)

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Dec 31, 2024
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Dec 31, 2024
@lucasew
Copy link
Contributor

lucasew commented Dec 31, 2024

Please introduce the packages in pkgs/by-name instead

EDIT: it will be easier to maintain because of bots

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. labels Dec 31, 2024
@js6pak
Copy link
Member Author

js6pak commented Dec 31, 2024

Please introduce the packages in pkgs/by-name instead

I want to move gpu-screen-recorder{,-gtk} first, not sure whether in another PR or this yet.

Copy link
Member

@keenanweaver keenanweaver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Here are my overall observations:

  • I think the ui module should be consolidated into the existing gpu-screen-recorder module instead of being a separate one. For instance programs.gpu-screen-recorder.ui.enable = true;
  • The service should be started by default with the ui.enable option set to true, but allow to be disabled.
  • Maybe allow for the notification to be disabled. Not sure why people would do that, but you never know.
  • Agreed that the package should be moved to by-name.

@lucasew
Copy link
Contributor

lucasew commented Dec 31, 2024

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 369574


x86_64-linux

⏩ 1 package blacklisted:
  • nixos-install-tools
✅ 2 packages built:
  • gpu-screen-recorder-notification
  • gpu-screen-recorder-ui

@js6pak
Copy link
Member Author

js6pak commented Dec 31, 2024

@keenanweaver

  • The service should be started by default with the ui.enable option set to true, but allow to be disabled.

That will break this setting in the app (it just won't have any effect), not sure whether we want to do it by default
image

  • Maybe allow for the notification to be disabled. Not sure why people would do that, but you never know.

You can disable it in-app
image

@Atemu
Copy link
Member

Atemu commented Jan 1, 2025

I want to move gpu-screen-recorder{,-gtk} first, not sure whether in another PR or this yet.

I don't see a any dependency on that.

You must init this in by-name by the way; it's policy now.

@h7x4 h7x4 added the 8.has: module (new) This PR adds a module in `nixos/` label Jan 17, 2025
@js6pak js6pak force-pushed the gpu-screen-recorder-ui/init branch from 83c78fe to 09a7171 Compare February 3, 2025 00:18
@js6pak js6pak marked this pull request as ready for review February 3, 2025 00:18
@js6pak js6pak requested review from babbaj and lucasew February 3, 2025 00:19
Copy link
Member

@keenanweaver keenanweaver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 369574


x86_64-linux

✅ 2 packages built:
  • gpu-screen-recorder-notification
  • gpu-screen-recorder-ui

Copy link
Member

@keenanweaver keenanweaver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

All functionality is seemingly working as intended. My recordings look weird but I probably have to set the appropriate options first.

@js6pak js6pak force-pushed the gpu-screen-recorder-ui/init branch from 09a7171 to d03a644 Compare February 8, 2025 20:37
@js6pak js6pak changed the title gpu-screen-recorder-ui: init at 1.0.0 gpu-screen-recorder-ui: init at 1.1.7 Feb 8, 2025
@keenanweaver keenanweaver added the 12.approvals: 1 This PR was reviewed and approved by one person. label Feb 10, 2025
@VeilSilence
Copy link
Contributor

VeilSilence commented Aug 17, 2025

❯ getcap /nix/store/knnqxpy6rbakrhhdbg496fv1hpzjhhy3-gpu-screen-recorder-ui-1.6.1/bin/gsr-global-hotkeys
empty

❯ getcap /nix/store/knnqxpy6rbakrhhdbg496fv1hpzjhhy3-gpu-screen-recorder-ui-1.6.1/bin/gsr-ui
empty

❯ pidof gsr-ui
2883

❯  cat /proc/2883/status | grep CapEff
CapEff:	0000000000000000

❯  pidof gpu-screen-recorder
42594

❯  cat /proc/42594/status | grep CapEff
CapEff:	0000000000800000

Yea, GPU-screen-recorder have cap_sys_nice.

@dec05eba
Copy link
Contributor

dec05eba commented Aug 17, 2025

The issue is here: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/programs/gpu-screen-recorder.nix#L37 gpu-screen-recorder package was updated but this wasn't. gpu-screen-recorder needed cap_sys_nice before, but it should no longer have that (it should have been removed when gsr-dbus-server was removed).

@VeilSilence
Copy link
Contributor

The issue is here: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/programs/gpu-screen-recorder.nix#L37 gpu-screen-recorder package was updated but this wasn't. gpu-screen-recorder needed cap_sys_nice before, but it should no longer have that (it should have been removed when gsr-dbus-server was removed).

1: Removed security.wrappers."gpu-screen-recorder. Do root ownership still required?
2: Added bash to buildinputs. Without bash, it's still complain about missing /bin/sh:

Patch

diff --git a/pkgs/by-name/gp/gpu-screen-recorder-ui/package.nix b/pkgs/by-name/gp/gpu-screen-recorder-ui/package.nix
index 68539fffa99a..cf3a5e9159ef 100644
--- a/pkgs/by-name/gp/gpu-screen-recorder-ui/package.nix
+++ b/pkgs/by-name/gp/gpu-screen-recorder-ui/package.nix
@@ -21,6 +21,7 @@
   wayland-scanner,
   wrapperDir ? "/run/wrappers/bin",
   gitUpdater,
+  bash,
 }:
 
 stdenv.mkDerivation rec {
@@ -62,6 +63,7 @@ stdenv.mkDerivation rec {
     libdrm
     wayland
     wayland-scanner
+    bash
   ];
 
   mesonFlags = [

`systemctl` output

 systemctl --user status gpu-screen-recorder-ui.service
● gpu-screen-recorder-ui.service - GPU Screen Recorder UI Service
     Loaded: loaded (/etc/systemd/user/gpu-screen-recorder-ui.service; enabled; preset: ignored)
    Drop-In: /nix/store/00b7nwlgr0qxhjia8hv7zdlpsi7p8l5q-user-units/gpu-screen-recorder-ui.service.d
             └─overrides.conf
     Active: active (running) since Sun 2025-08-17 15:48:08 +03; 5min ago
 Invocation: 06d8199bc0d64457ab00ed6730b957cf
   Main PID: 231175 (.gsr-ui-wrapped)
      Tasks: 11 (limit: 76913)
     Memory: 417.8M (peak: 421.3M)
        CPU: 44.019s
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/gpu-screen-recorder-ui.service
             ├─231175 /nix/store/30x1hg98r3nh8b2ypba8wc02g6m9cqhk-gpu-screen-recorder-ui-1.6.1/bin/gsr-ui launch-daemon
             ├─231229 /nix/store/30x1hg98r3nh8b2ypba8wc02g6m9cqhk-gpu-screen-recorder-ui-1.6.1/bin/gsr-global-hotkeys --all
             └─232447 /nix/store/f8glvxqapbf65rx04pzqbmkxmnbaxvr1-gpu-screen-recorder-5.6.5/bin/.wrapped/gpu-screen-recorder -w portal -c mp4 -ac opus -cursor yes -cr lim>

Aug 17 15:48:54 Nix gsr-ui[232447]: gsr info: pipewire:    Framerate: 0/1
Aug 17 15:48:54 Nix gsr-ui[232447]: gsr info: pipewire: negotiated format:
Aug 17 15:48:54 Nix gsr-ui[232447]: gsr info: pipewire:    Format: 8 (Spa:Enum:VideoFormat:BGRx)
Aug 17 15:48:54 Nix gsr-ui[232447]: gsr info: pipewire:    Modifier: 0x300000000606014
Aug 17 15:48:54 Nix gsr-ui[232447]: gsr info: pipewire:    Size: 2560x1440
Aug 17 15:48:54 Nix gsr-ui[232447]: gsr info: pipewire:    Framerate: 0/1
Aug 17 15:48:54 Nix gsr-ui[232447]: gsr info: pipewire: stream 0x1b0d4fe0 previous state: "paused", new state: "streaming" (error: none)
Aug 17 15:48:54 Nix gsr-ui[232447]: gsr info: gsr_capture_portal_start: pipewire negotiation finished
Aug 17 15:48:55 Nix gsr-ui[232447]: gsr info: using h264 encoder because a codec was not specified
Aug 17 15:48:55 Nix gsr-ui[232447]: [h264_nvenc @ 0x1b8900c0] ignoring invalid SAR: 0/0

Portals are working, and region selection also appeared.
Fonts kinda ugly tho.. Maybe we can add option to change font in app. I'll take are look.

@keenanweaver
Copy link
Member

Thank you for diving into that. I was wondering if it was just me with the portal issue. Everything's working for me again after the above changes. (ignore my own changes) keenanweaver/nix-config@cdced96

@taha-yassine
Copy link
Contributor

Any chance this gets merged?

@js6pak
Copy link
Member Author

js6pak commented Sep 12, 2025

gpu-screen-recorder needed cap_sys_nice before, but it should no longer have that (it should have been removed when gsr-dbus-server was removed).

My bad! Missed that when updating gpu-screen-recorder, portal capture should work again with #442391

@js6pak js6pak force-pushed the gpu-screen-recorder-ui/init branch from bd189dd to 75c9ed9 Compare September 12, 2025 14:31
@js6pak js6pak changed the title gpu-screen-recorder-ui: init at 1.6.1 gpu-screen-recorder-ui: init at 1.7.5 Sep 12, 2025
@nixpkgs-ci nixpkgs-ci bot removed the 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. label Sep 12, 2025
@h4rldev
Copy link
Contributor

h4rldev commented Sep 18, 2025

praying for this to be merged soon

gitUpdater,
}:

stdenv.mkDerivation rec {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick (because I don't think this is enforced in any documentation yet), but if necessary this could be a finalAttrs instead of using rec.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my rationale in #367552 (comment) and #367552 (comment). finalAttrs vs rec here have their own readability/perf/overriding traps tradeoffs, and I still don't think there is a consensus on what should be used.

in
{
options = {
programs.gpu-screen-recorder-ui = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on having this be in programs.gpu-screen-recorder.ui or something similar instead of clogging up the namespace.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thinking is that gpu-screen-recorder/gpu-screen-recorder-ui are designed in a way to be independent of each other, so it makes sense to treat them as separate projects. The frontend could have very well been made by a different person, in which case it would feel weird to merge the options.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gpu-screen-recorder-ui assumes that it can call gpu-screen-recorder with very specific options, so that sounds highly dependent to me (and we are even setting programs.gpu-screen-recorder.enabled if programs.gpu-screen-recorder-ui.enabled is given). Further, even if someone makes a compatible third-party backend in the future then the contract would still feasibly be named gpu-screen-recorder, since that is what the compatibility is measured by.

Therefore, it would be reasonable to have everything in programs.gpu-screen-recorder, since there will be programs.gpu-screen-recorder.package to adjust the backend implementation and programs.gpu-screen-recorder.ui.package to adjust the frontend implementation (and the respective enable options, obviously).

That said, according to the derivation, gpu-screen-recorder-ui currently strictly depends on the gpu-screen-recorder derivation with no way of changing that, so any argument about them being any kind of independent is moot anyway.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current programs.gpu-screen-recorder/programs.gpu-screen-recorder-ui modules are really only for the setuid wrappers, so an alternative frontend wouldn't have a reason to reuse it. Like in my mind, what you are suggesting would be akin to adding a programs.ffmpeg.{vlc,mpv}.enable.

@js6pak js6pak changed the title gpu-screen-recorder-ui: init at 1.7.5 gpu-screen-recorder-ui: init at 1.8.0 Nov 10, 2025
@js6pak js6pak force-pushed the gpu-screen-recorder-ui/init branch from 75c9ed9 to df7458e Compare November 10, 2025 20:45
@js6pak js6pak requested a review from timschumi November 10, 2025 21:02
@matkijahenkilo
Copy link

The NIXOS_OZONE_WL variable has some weird interactions with this package, it seems.
when setting it to true for the session or an specific application like Discord, it disables the possibility of writing anything in text boxes, it's just possible to erase what's inside of it already. When noting using this variable at all, GSR-UI works without any issues. Also dunno if it's of great relevance but the cursor also duplicates

(running this on kde plasma wayland, GSR 5.8.1, GSR-UI 1.8.0)

Video_2025-12-16_18-50-21.mp4

I absolutely love this program, thank you for packaging it!

@js6pak js6pak force-pushed the gpu-screen-recorder-ui/init branch from df7458e to e2b61c6 Compare December 21, 2025 15:09
@js6pak js6pak changed the title gpu-screen-recorder-ui: init at 1.8.0 gpu-screen-recorder-ui: init at 1.8.3 Dec 21, 2025
@js6pak
Copy link
Member Author

js6pak commented Dec 21, 2025

@matkijahenkilo

running this on kde plasma wayland, GSR 5.8.1, GSR-UI 1.8.0

I'm on the same setup and can't reproduce, so not sure what the issue is. Likely an upstream bug though.

@dec05eba
Copy link
Contributor

dec05eba commented Dec 21, 2025

@matkijahenkilo As mention in the notification when you first launch gsr ui, it cant work properly on wayland because of wayland limitations (specifically with how it interacts with xwayland applications (games), since they get minimized when you open a fullscreen application when the game is fullscreen). It will never be possible to make it work properly on wayland and it instead has to rely on multiple hacks and undefined behavior in different wayland compositors + xwayland to hopefully work, in every scenario.

The fix for your issue would be to add yet another hack that hopefully works. Report the issue you have by email as mentioned here: https://git.dec05eba.com/?p=about and explain exactly how to reproduce it, for example which terminal that is that you have focused. I think in your case the issue is that you have an x11 application in the background (the browser) that is fullscreen while the terminal is a wayland application. If you try to make the browser a window instead of fullscreen and then open the gsr ui again then I dont think you would have that issue of typing text in terminal and gsr ui at the same time.

@VeilSilence
Copy link
Contributor

@dec05eba I'm wondering if it works any better, when I run games under the "Wayland native" with PROTON_ENABLE_WAYLAND=1 on proton-ge.
Thank you for amazing app also.

@dec05eba
Copy link
Contributor

@VeilSilence The issue could still happen in that case. I believe the issue specifically in this case is having a fullscreen x11 application, even if it's in the background. If you had that and then opened a wayland native game in fullscreen you would still experience the issue. The issue would disappear if you dont have any x11 application running fullscreen or dont have any x11 application running at all. I may be able to workaround that issue, I'll have to look into it.

@dec05eba
Copy link
Contributor

@matkijahenkilo @VeilSilence I added a workaround for this issue that works now and it will be available in the next update. Although this is off-topic and further discussion should be done by email as mentioned here: https://git.dec05eba.com/?p=about

@Moerliy
Copy link

Moerliy commented Feb 17, 2026

Any hopes for this to get the last push it needs?

@js6pak js6pak force-pushed the gpu-screen-recorder-ui/init branch from e2b61c6 to 73728d0 Compare February 20, 2026 18:40
@js6pak js6pak changed the title gpu-screen-recorder-ui: init at 1.8.3 gpu-screen-recorder-ui: init at 1.10.8 Feb 20, 2026
@js6pak js6pak force-pushed the gpu-screen-recorder-ui/init branch from 73728d0 to 927cd45 Compare February 20, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Package request: gpu-screen-recorder-ui