From 70e33b355caa548c4378b78b296361086b653ca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Eug=C3=AAnio?= Date: Tue, 29 Nov 2022 15:50:12 -0300 Subject: [PATCH] add gamemode --- system/configuration.nix | 5 ++++- system/gamemode.nix | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 system/gamemode.nix diff --git a/system/configuration.nix b/system/configuration.nix index d389713..966f051 100644 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -2,7 +2,10 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). { config, pkgs, inputs, ... }: { - imports = [ ./media-packages.nix ]; + imports = [ + ./gamemode.nix + ./media-packages.nix + ]; packages.media-packages.enable = true; # Bootloader. diff --git a/system/gamemode.nix b/system/gamemode.nix new file mode 100644 index 0000000..52e8774 --- /dev/null +++ b/system/gamemode.nix @@ -0,0 +1,21 @@ +{ config, pkgs, inputs, ... }: { + programs.gamemode.enable = true; + programs.gamemode.enableRenice = true; + programs.gamemode.settings = { + general = { + renice = 10; + }; + + # Warning: GPU optimisations have the potential to damage hardware + gpu = { + apply_gpu_optimisations = "accept-responsibility"; + gpu_device = 0; + amd_performance_level = "high"; + }; + + custom = { + start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'"; + end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'"; + }; + }; +}