meta: Various gaming fixes

- Fix Vortex Mod Manager by giving it access to /mnt/Storage (Bad, but
  well)
- Add package: razer-cli
- Tell gamemode to put my GPU in performance mode
- Tell gamemode to enable or disable keyboard backlight
- Switch the miku kernel to Zen
This commit is contained in:
PapaTutuWawa 2022-05-03 15:04:01 +02:00
parent 1361348bf1
commit 648da7e05a
6 changed files with 77 additions and 18 deletions

View File

@ -47,7 +47,7 @@
evolution evolution
# Proprietary stuff (yikes) # Proprietary stuff (yikes)
discord-wrapped #discord-app-wrapped discord-wrapped discord-app-wrapped
spotify-wrapped spotify-wrapped
vortex-wrapped vortex-wrapped
zoom-vm zoom-vm
@ -114,7 +114,9 @@
#}; #};
}; };
boot = { boot = let
kernel = pkgs.linuxPackages_zen;
in {
extraModprobeConfig = '' extraModprobeConfig = ''
options kvm_amd nested=1 options kvm_amd nested=1
options vfio-pci ids=1002:67df,1002:aaf0 options vfio-pci ids=1002:67df,1002:aaf0
@ -144,12 +146,12 @@
"pci=noaer" "pci=noaer"
]; ];
extraModulePackages = [ pkgs.linuxPackages_xanmod.vendor-reset ]; extraModulePackages = [ kernel.vendor-reset ];
# NOTE: A regression appears to have happend between 5.10 and 5.12 # NOTE: A regression appears to have happend between 5.10 and 5.12
# which leads to the RX590 to have the fence fallback timer on # which leads to the RX590 to have the fence fallback timer on
# sdma0 time out (whatever this means). Maybe bisect? # sdma0 time out (whatever this means). Maybe bisect?
kernelPackages = pkgs.linuxPackages_xanmod; kernelPackages = kernel;
}; };
services = { services = {
ratbagd.enable = true; ratbagd.enable = true;
@ -168,6 +170,11 @@
hardware = { hardware = {
opentabletdriver.enable = true; opentabletdriver.enable = true;
openrazer = {
enable = true;
devicesOffOnScreensaver = true;
users = [ "alexander" ];
};
}; };
# TODO: Move into modules # TODO: Move into modules

View File

@ -8,7 +8,10 @@ in {
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
wineWowPackages.staging winetricks lutris-free-wrapped wineWowPackages.staging winetricks
protontricks
lutris-free-wrapped
(pkgs.callPackage ./wrapper.nix { (pkgs.callPackage ./wrapper.nix {
inherit (pkgs) retroarch; inherit (pkgs) retroarch;
@ -20,6 +23,8 @@ in {
steam-wrapped # Custom package steam-wrapped # Custom package
nur.repos.dukzcry.gamescope nur.repos.dukzcry.gamescope
corectrl
]; ];
hardware.steam-hardware.enable = true; hardware.steam-hardware.enable = true;

View File

@ -1,4 +1,4 @@
{ config, lib, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.ptw.services.gamemode; cfg = config.ptw.services.gamemode;
@ -23,6 +23,24 @@ in {
ioprio = 0; ioprio = 0;
inhibit_screensaver = 1; inhibit_screensaver = 1;
}; };
gpu = {
amd_performance_level = "high";
};
custom = let
razerBrightnessStartScript = pkgs.writeShellScriptBin "razer-brightness-start.sh" ''
${pkgs.razer-cli}/bin/razer-cli -d "Razer BlackWidow Ultimate 2013" -b 1
${pkgs.razer-cli}/bin/razer-cli -d "Razer Tartarus V2" -b 50
'';
razerBrightnessStopScript = pkgs.writeShellScriptBin "razer-brightness-stop.sh" ''
${pkgs.razer-cli}/bin/razer-cli -d "Razer BlackWidow Ultimate 2013" -b 0
${pkgs.razer-cli}/bin/razer-cli -d "Razer Tartarus V2" -b 0
'';
in {
start = ''${razerBrightnessStartScript}/bin/razer-brightness-start.sh'';
end = ''${razerBrightnessStopScript}/bin/razer-brightness-stop.sh'';
};
}; };
}; };
}; };

View File

@ -3,27 +3,30 @@ final: prev:
let let
wrapInSandbox = prev.callPackage ../lib/sandbox.nix {}; wrapInSandbox = prev.callPackage ../lib/sandbox.nix {};
in { in {
/*
discord-app-wrapped = wrapInSandbox { discord-app-wrapped = wrapInSandbox {
name = "discord-app"; name = "discord-app-wrapped";
package = prev.discord-app; launchScriptName = "discord-app";
binaryName = "discord-app"; binary = "${prev.discord-app}/bin/discord-app";
mountInHome = [ ".local/share/discord-app" ]; mountInHome = [ ".local/share/discord-app" ];
additionalBlacklist = [ "/mnt" ]; additionalBlacklist = [ "/mnt" ];
chdirTo = "/home/$USER"; chdirTo = "/home/$USER";
version = "1.0.0"; preDesktopFilePhase = ''
desktopFileArgs = { mkdir -p $out/share/icons
cp -L ${prev.discord}/share/pixmaps/discord.png $out/share/icons/discord.png
'';
desktopFileAttributes = {
name = "discord-app-wrapped"; name = "discord-app-wrapped";
#exec = "discord"; #exec = "discord";
icon = "discord"; icon = "discord";
desktopName = "Discord-App (wrapped)"; desktopName = "Discord-App (wrapped)";
genericName = "Instant Messenger"; genericName = "Instant Messenger";
categories = [ "Network" "InstantMessaging" ]; #categories = [ "Network" "InstantMessaging" ];
}; };
enableDesktopFile = true;
}; };
minecraft-wrapped = wrapInSandbox { /*minecraft-wrapped = wrapInSandbox {
name = "minecraft-launcher"; name = "minecraft-launcher";
package = prev.minecraft; package = prev.minecraft;
binaryName = "minecraft-launcher"; binaryName = "minecraft-launcher";
@ -40,7 +43,7 @@ in {
additionalBlacklist = [ "/mnt" ]; additionalBlacklist = [ "/mnt" ];
additionalMounts = [ "/mnt/Storage/Games/SteamLibrary" ]; additionalMounts = [ "/mnt/Storage/Games/SteamLibrary" ];
chdirTo = "/home/$USER"; chdirTo = "/home/$USER";
preDesktopFilePhase = '' preDesktopFilePhase = ''
cp -Lr ${prev.steam}/share/icons $out/share/icons cp -Lr ${prev.steam}/share/icons $out/share/icons
''; '';
@ -138,12 +141,14 @@ in {
chdirTo = "/mnt/Storage/Games/"; chdirTo = "/mnt/Storage/Games/";
additionalBlacklist = [ "/mnt" ]; additionalBlacklist = [ "/mnt" ];
additionalMounts = [ additionalMounts = [
# TODO: It doesn't work if we restrict it more
"/mnt/Storage"
# Wine prefix # Wine prefix
"/mnt/Storage/Games/NewVortex" #"/mnt/Storage/Games/NewVortex"
# Mod cache # Mod cache
"/mnt/Storage/Vortex Mods" #"/mnt/Storage/Vortex Mods"
# Only access Skyrim: SE # Only access Skyrim: SE
"/mnt/Storage/Games/SteamLibrary/SteamLibrary/steamapps/common/Skyrim\ Special\ Edition/" #"/mnt/Storage/Games/SteamLibrary/SteamLibrary/steamapps/common/Skyrim\ Special\ Edition/"
]; ];
mountInHome = [ mountInHome = [
# Mod downloads # Mod downloads

View File

@ -68,4 +68,6 @@ in {
}; };
zoom-vm = prev.callPackage scripts/zoom-vm {}; zoom-vm = prev.callPackage scripts/zoom-vm {};
razer-cli = prev.callPackage tools/hardware/razer-cli {};
} }

View File

@ -0,0 +1,22 @@
{
lib,
fetchFromGitHub,
python3, xorg
}:
python3.pkgs.buildPythonPackage rec {
pname = "razer-cli";
version = "2.1.0";
src = fetchFromGitHub {
owner = "LoLei";
repo = "razer-cli";
rev = "v${version}";
sha256 = "0vcyssswsw7gzk2xlpvcqc9fgvwxzyivsqmw5r9b391dv3wpr1y7";
};
doCheck = false;
buildInputs = [ xorg.xrdb ];
propagatedBuildInputs = with python3.pkgs; [ setuptools openrazer ];
}