gamer improvements

This commit is contained in:
notgne2 2022-05-14 08:58:40 -07:00
parent b0418eb56f
commit 4b500953fd
No known key found for this signature in database
GPG key ID: 5CE0A245A2DAC84A
3 changed files with 75 additions and 14 deletions

View file

@ -72,9 +72,32 @@ in
default = false;
description = "If you want to include wine-staging as new-wine";
};
sunshineService = mkOption {
type = types.bool;
description = "Enable sunshine game streaming service";
};
steamService = mkOption {
type = types.bool;
description = "Enable running steam as a service";
};
scService = mkOption {
type = types.bool;
description = "Enable running sc-controller as a service. This integrates with steamService to make sure your steam controller will continuously be mapped.";
};
};
config = mkIf cfg.enable {
gaming.sunshineService = mkOptionDefault false;
gaming.steamService = mkOptionDefault cfg.sunshineService;
gaming.scService = mkOptionDefault cfg.steamService;
home.sessionVariables = {
STAGING_RT_PRIORITY_SERVER = 90;
};
home.packages =
let
newwine = (pkgs.wineFull.override { wineBuild = "wineWow"; wineRelease = "staging"; });
@ -101,17 +124,10 @@ in
oldwine
oldwinetricks
(pkgs.writeShellScriptBin "steam" "${pkgs.systemd}/bin/systemctl --user start steam")
sc-controller
dolphinEmuMaster
ark
unzip
unrar
mpv
tuxpaint
extremetuxracer
@ -125,9 +141,9 @@ in
ln -s ${newwinetricks}/bin/winetricks $out/bin/new-winetricks
''
)
];
] ++ lib.optional cfg.steamService (pkgs.writeShellScriptBin "steam" "${pkgs.systemd}/bin/systemctl --user start steam");
systemd.user.services.sunshine = {
systemd.user.services.sunshine = mkIf cfg.sunshineService {
Unit = {
Description = "Host for Moonlight Streaming Client";
Requires = [ "dbus.service" ];
@ -162,7 +178,7 @@ in
};
};
systemd.user.services.scc = {
systemd.user.services.scc = mkIf cfg.scSerice {
Unit = {
Description = "User-mode driver and GTK3 based GUI for Steam Controller";
After = [ "graphical-session-pre.target" ];
@ -179,7 +195,7 @@ in
Install = { WantedBy = [ "graphical-session.target" ]; };
};
systemd.user.services.steam = {
systemd.user.services.steam = mkIf cfg.steamService {
Unit = {
Description = "Start Steam gaming platform";
After = [ "graphical-session-pre.target" ];
@ -196,7 +212,7 @@ in
/run/current-system/sw/bin/steam -fulldesktopres
'';
in
"${steamStart}";
lib.mkIf cfg.scService "${steamStart}";
ExecStop =
let
steamStop = pkgs.writeShellScript "steam-stop" ''
@ -204,7 +220,7 @@ in
${pkgs.systemd}/bin/systemctl --user start scc
'';
in
"${steamStop}";
lib.mkIf cfg.scService "${steamStop}";
};
Install = { WantedBy = [ "graphical-session.target" ]; };