Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

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 labels Dec 31, 2024
hash = "sha256-cyM3y1MYZNEHKyiyAqYXcSwZe0tcnPNukxErm/dIo6Y=";
};

sourceRoot = ".";
Copy link
Contributor

Choose a reason for hiding this comment

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

No need for this

Copy link
Member Author

Choose a reason for hiding this comment

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

stdenv expects the src to have a single directory after extracting if you don't set sourceRoot. But this tarball isn't like that, it has the source files directly in root

Copy link
Member

Choose a reason for hiding this comment

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

Why is the src a tarball anyways? Why not use fetchgit?

Copy link
Member Author

@js6pak js6pak Jan 1, 2025

Choose a reason for hiding this comment

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

Why is the src a tarball anyways? Why not use fetchgit?

I just followed what @babbaj did for gpu-screen-recorder{,-gtk}, found reasoning for the initial change here: #268443 (comment) (upstream asked for it)

Copy link
Member

Choose a reason for hiding this comment

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

I see. I don't think that reasoning is sound though as fetchgit does indeed do a "shallow" clone (--depth=1) and, unless the speed is abhorrently slow, this doesn't really matter. Each revision needs to be fetched once by a handful of instances:

  • authors of update PRs
  • reviewers of update PRs
  • hydra

Most everyone else will either get the cached binary output path and doesn't need to fetch the source at all or they will fetch the cached source path from hydra.

If you really don't want fetchgit, you should at least use fetchzip instead.

cc @dec05eba

Copy link
Contributor

@dec05eba dec05eba Jan 1, 2025

Choose a reason for hiding this comment

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

src taraball is preferred as its faster on the slow server and increases the load less. But in this case where it does a shallow clone and clone is only done by the ones you mentioned then fetchgit is ok, if it provides a benefit. The git link is primarly intended for development, not distribution, so it's discouraged unless there is a reason to use it.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Atemu What's even the advantage of fetchgit here? And for fetchzip vs fetchurl, I guess the only difference is whether you hash the contents or the compressed file?

Copy link
Member

Choose a reason for hiding this comment

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

fetchgit is the closest to the actual source.

As we've learned in April, a tarball can contain anything Jia Tan wants it to and it's quite a lot easier to hide stuff in a rando tarball download vs. a git history.

fetchzip unpacks a given archive and thereby abstracts away any oddities in how it's packaged up which you had to work around here.

Copy link
Member Author

Choose a reason for hiding this comment

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

On my machine fetching the tarball takes about 0.3s, while doing a shallow clone takes ~0.6s.
So with the increased load concern being solved by hydra, I'll go with fetchgit.

hash = "sha256-2gB6FWys5RGDlwc1OZ0NnjU8eIGJefpjc94YKJSnyPI=";
};

sourceRoot = ".";
Copy link
Contributor

Choose a reason for hiding this comment

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

No need for this

@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 the maintainer of 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.

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 (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 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package request: gpu-screen-recorder-ui
6 participants