nixos/gpu-screen-recorder: add UI option with UI and notification package

add option for ui.enable to install gsr-ui package and setup correct set_cap for hotkeys

(cherry picked from commit 790b039197)
This commit is contained in:
AhmedAmrNabil
2026-06-18 23:51:31 +03:00
committed by github-actions[bot]
parent 9fec61a048
commit ea2cc05cf5

View File

@@ -10,6 +10,11 @@ let
package = cfg.package.override {
inherit (config.security) wrapperDir;
};
uiPackage = cfg.ui.package.override {
gpu-screen-recorder = package;
inherit (config.security) wrapperDir;
};
in
{
options = {
@@ -24,19 +29,47 @@ in
wrappers for promptless recording.
'';
};
ui = {
enable = lib.mkEnableOption "the GPU Screen Recorder overlay UI";
package = lib.mkPackageOption pkgs "gpu-screen-recorder-ui" { };
notifPackage = lib.mkPackageOption pkgs "gpu-screen-recorder-notification" { };
};
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
config = lib.mkIf cfg.enable (
lib.mkMerge [
{
environment.systemPackages = [ cfg.package ];
security.wrappers."gsr-kms-server" = {
owner = "root";
group = "root";
capabilities = "cap_sys_admin+ep";
source = lib.getExe' package "gsr-kms-server";
};
};
security.wrappers."gsr-kms-server" = {
owner = "root";
group = "root";
capabilities = "cap_sys_admin+ep";
source = lib.getExe' package "gsr-kms-server";
};
}
meta.maintainers = with lib.maintainers; [ timschumi ];
(lib.mkIf cfg.ui.enable {
environment.systemPackages = [
cfg.ui.package
cfg.ui.notifPackage
];
security.wrappers."gsr-global-hotkeys" = {
owner = "root";
group = "root";
capabilities = "cap_setuid+ep";
source = lib.getExe' uiPackage "gsr-global-hotkeys";
};
})
]
);
meta.maintainers = with lib.maintainers; [
timschumi
AhmedAmr
keenanweaver
];
}