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.1.7 #369574

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@
./programs/gpaste.nix
./programs/gphoto2.nix
./programs/gpu-screen-recorder.nix
./programs/gpu-screen-recorder-ui.nix
./programs/haguichi.nix
./programs/hamster.nix
./programs/htop.nix
Expand Down
46 changes: 46 additions & 0 deletions nixos/modules/programs/gpu-screen-recorder-ui.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
config,
lib,
pkgs,
...
}:

let
cfg = config.programs.gpu-screen-recorder-ui;
package = cfg.package.override {
inherit (config.security) wrapperDir;
};
in
{
options = {
programs.gpu-screen-recorder-ui = {
package = lib.mkPackageOption pkgs "gpu-screen-recorder-ui" { };

enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to install gpu-screen-recorder-ui and generate setcap
wrappers for global hotkeys.
'';
};
};
};

config = lib.mkIf cfg.enable {
programs.gpu-screen-recorder.enable = lib.mkDefault true;

environment.systemPackages = [ package ];

systemd.packages = [ package ];

security.wrappers."gsr-global-hotkeys" = {
owner = "root";
group = "root";
capabilities = "cap_setuid+ep";
source = lib.getExe' package "gsr-global-hotkeys";
};
};

meta.maintainers = with lib.maintainers; [ js6pak ];
}
57 changes: 57 additions & 0 deletions pkgs/by-name/gp/gpu-screen-recorder-notification/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
lib,
stdenv,
fetchgit,
pkg-config,
meson,
ninja,
libX11,
libXrender,
libXrandr,
libXext,
libglvnd,
gitUpdater,
}:

stdenv.mkDerivation rec {
pname = "gpu-screen-recorder-notification";
version = "1.0.3";

src = fetchgit {
url = "https://repo.dec05eba.com/${pname}";
tag = version;
hash = "sha256-FDN1OdhN9V6I9/Z1V17YSKUqcp9yz7jpsTJqmoLBfrQ=";
};

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
];

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;
};
}
91 changes: 91 additions & 0 deletions pkgs/by-name/gp/gpu-screen-recorder-ui/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
lib,
stdenv,
fetchgit,
pkg-config,
meson,
ninja,
makeWrapper,
gpu-screen-recorder,
gpu-screen-recorder-notification,
libX11,
libXrender,
libXrandr,
libXcomposite,
libXi,
libXcursor,
libglvnd,
wrapperDir ? "/run/wrappers/bin",
gitUpdater,
}:

stdenv.mkDerivation rec {
pname = "gpu-screen-recorder-ui";
version = "1.1.7";

src = fetchgit {
url = "https://repo.dec05eba.com/${pname}";
tag = version;
hash = "sha256-8KBBuZhb5e/Xh2MwxHSVXLETQz9Koi+0IEdp2adp0aM=";
};

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
];

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 = "A 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;
};
}