Skip to content

Commit

Permalink
create and enable gpu-screen-recorder-replay service
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelBelsanti committed Jan 2, 2025
1 parent 192ca5d commit 355b984
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
14 changes: 14 additions & 0 deletions modules/nixos/gaming/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ let
in
{
options.gaming.enable = mkBoolOpt false "Enable all gaming packages and configurations.";
options.gaming.replays.enable = mkBoolOpt false "Enable instant replays using gpu-screen-recorder.";
options.gaming.replays.portal = mkBoolOpt false "Use portal for instant replays";
options.gaming.replays.screen = mkBoolOpt false "Screen to be used for instant replays, if not using portal.";

config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
Expand Down Expand Up @@ -84,6 +87,17 @@ in
};
};
snowfallorg.users.${user}.home.config = {
systemd.user.services.gpu-screen-recorder-replay = {
# Save a video using `killall -SIGUSR1 gpu-screen-recorder` (or any other way to send a SIGUSR1 signal to gpu-screen-recorder)
Unit.Description = "gpu-screen-recorder replay service";
Install.WantedBy = [ "default.target" ];
Service = let
w = if cfg.replays.portal then "portal" else cfg.replays.screen;
in {
ExecStartPre = "/usr/bin/env mkdir -p %h/Videos/Replays";
ExecStart = "${lib.getExe pkgs.gpu-screen-recorder} -w ${w} -f 60 -r 60 -a 'default_output|default_input' -c mp4 -q very_high -o %h/Videos/Replays -restore-portal-session yes";
};
};
programs.obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
Expand Down
10 changes: 8 additions & 2 deletions systems/x86_64-linux/hades/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,14 @@
cosmic.enable = true;
};

gaming.enable = true;
apps.unmanic.enable = true;
gaming = {
enable = true;
replays = {
enable = true;
portal = true;
};
};
apps.unmanic.enable = false;
programs.steam.gamescopeSession.args = [ "--adaptive-sync --display-index 2" ];

networking = {
Expand Down

0 comments on commit 355b984

Please sign in to comment.