From 95d9f9cf6135910ed0291c42de1f429ee61f18ae Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Thu, 24 Apr 2025 14:06:27 +0200 Subject: [PATCH] Add gamemode --- hosts/aspi/default.nix | 4 +++- hosts/common/optional/gamemode.nix | 24 ++++++++++++++++++++++++ hosts/common/users/julian/default.nix | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 hosts/common/optional/gamemode.nix diff --git a/hosts/aspi/default.nix b/hosts/aspi/default.nix index ad118db..0205b72 100644 --- a/hosts/aspi/default.nix +++ b/hosts/aspi/default.nix @@ -22,7 +22,9 @@ # ../common/optional/gdm.nix ../common/optional/greetd.nix - ../common/optional/redshift.nix + ../common/optional/gamemode.nix + # ../common/optional/redshift.nix + # ../common/optional/redshift.nix ../common/optional/virtualbox.nix ../common/optional/xdg-portal.nix # TODO: not needed? ../common/optional/polkit.nix # TODO: maybe not needed! diff --git a/hosts/common/optional/gamemode.nix b/hosts/common/optional/gamemode.nix new file mode 100644 index 0000000..8c036e1 --- /dev/null +++ b/hosts/common/optional/gamemode.nix @@ -0,0 +1,24 @@ +{ pkgs, ... }: +{ + + programs.gamemode = { + enable = true; + settings = { + general = { + softrealtime = "auto"; + inhibit_screensaver = 1; + renice = 5; + }; + # gpu = { + # apply_gpu_optimisations = "accept-responsibility"; + # gpu_device = 1; + # amd_performance_level = "high"; + # }; + custom = { + start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'"; + end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'"; + }; + }; + }; + +} diff --git a/hosts/common/users/julian/default.nix b/hosts/common/users/julian/default.nix index 937daee..4f1bc96 100644 --- a/hosts/common/users/julian/default.nix +++ b/hosts/common/users/julian/default.nix @@ -24,6 +24,7 @@ in "podman" "docker" "git" + "gamemode" ]; openssh.authorizedKeys.keys = lib.splitString "\n" (