mass reformat

This commit is contained in:
notgne2 2022-10-03 17:08:32 -07:00
parent ed1c53e94c
commit 9cb456ad60
No known key found for this signature in database
GPG key ID: 5CE0A245A2DAC84A
25 changed files with 1216 additions and 1043 deletions

View file

@ -1,10 +1,12 @@
inputs:
{ config, lib, pkgs, ... }:
with lib;
let
inputs: {
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.gaming;
in
{
in {
options.gaming = {
enable = mkEnableOption "Enable gaming stuff";
@ -33,53 +35,58 @@ in
STAGING_RT_PRIORITY_SERVER = 90;
};
home.packages =
let
newwine = (pkgs.winePackages.full.override { wineBuild = "wineWow"; wineRelease = "staging"; });
newwinetricks = pkgs.winetricks.overrideAttrs (old: rec {
pathAdd = "${newwine}/bin:" + old.pathAdd;
postInstall = ''
sed -i \
-e '2i PATH="${pathAdd}"' \
"$out/bin/winetricks"
'';
});
home.packages = let
newwine = pkgs.winePackages.full.override {
wineBuild = "wineWow";
wineRelease = "staging";
};
newwinetricks = pkgs.winetricks.overrideAttrs (old: rec {
pathAdd = "${newwine}/bin:" + old.pathAdd;
postInstall = ''
sed -i \
-e '2i PATH="${pathAdd}"' \
"$out/bin/winetricks"
'';
});
oldwine = pkgs.wineWowPackages.full;
oldwinetricks = pkgs.winetricks.overrideAttrs (old: rec {
pathAdd = "${oldwine}/bin:" + old.pathAdd;
postInstall = ''
sed -i \
-e '2i PATH="${pathAdd}"' \
"$out/bin/winetricks"
'';
});
in
with pkgs; [
oldwine
oldwinetricks
oldwine = pkgs.wineWowPackages.full;
oldwinetricks = pkgs.winetricks.overrideAttrs (old: rec {
pathAdd = "${oldwine}/bin:" + old.pathAdd;
postInstall = ''
sed -i \
-e '2i PATH="${pathAdd}"' \
"$out/bin/winetricks"
'';
});
in
with pkgs;
[
oldwine
oldwinetricks
sc-controller
sc-controller
tuxpaint
extremetuxracer
] ++ lib.optionals cfg.newWine [
(
pkgs.runCommand "new-wine-stuff"
{ } ''
mkdir -p $out/bin
ln -s ${newwine}/bin/wine $out/bin/new-wine
ln -s ${newwine}/bin/winecfg $out/bin/new-winecfg
ln -s ${newwinetricks}/bin/winetricks $out/bin/new-winetricks
''
)
] ++ lib.optional cfg.steamService (pkgs.writeShellScriptBin "steam" "${pkgs.systemd}/bin/systemctl --user start steam");
tuxpaint
extremetuxracer
]
++ lib.optionals cfg.newWine [
(
pkgs.runCommand "new-wine-stuff"
{} ''
mkdir -p $out/bin
ln -s ${newwine}/bin/wine $out/bin/new-wine
ln -s ${newwine}/bin/winecfg $out/bin/new-winecfg
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.scc = mkIf cfg.scService {
Unit = {
Description = "User-mode driver and GTK3 based GUI for Steam Controller";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
After = ["graphical-session-pre.target"];
PartOf = ["graphical-session.target"];
};
Service = {
@ -89,38 +96,36 @@ in
RestartSec = 5;
};
Install = { WantedBy = [ "graphical-session.target" ]; };
Install = {WantedBy = ["graphical-session.target"];};
};
systemd.user.services.steam = mkIf cfg.steamService {
Unit = {
Description = "Start Steam gaming platform";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
After = ["graphical-session-pre.target"];
PartOf = ["graphical-session.target"];
};
Service = {
Type = "simple";
ExecStart =
let
steamStart = pkgs.writeShellScript "steam-start" ''
${pkgs.systemd}/bin/systemctl --user stop scc
# no sleep is needed here because steam is slow as fuck lol
/run/current-system/sw/bin/steam -fulldesktopres
'';
in
ExecStart = let
steamStart = pkgs.writeShellScript "steam-start" ''
${pkgs.systemd}/bin/systemctl --user stop scc
# no sleep is needed here because steam is slow as fuck lol
/run/current-system/sw/bin/steam -fulldesktopres
'';
in
lib.mkIf cfg.scService "${steamStart}";
ExecStop =
let
steamStop = pkgs.writeShellScript "steam-stop" ''
${pkgs.coreutils}/bin/sleep 5 # give time for controller to reset
${pkgs.systemd}/bin/systemctl --user start scc
'';
in
ExecStop = let
steamStop = pkgs.writeShellScript "steam-stop" ''
${pkgs.coreutils}/bin/sleep 5 # give time for controller to reset
${pkgs.systemd}/bin/systemctl --user start scc
'';
in
lib.mkIf cfg.scService "${steamStop}";
};
Install = { WantedBy = [ "graphical-session.target" ]; };
Install = {WantedBy = ["graphical-session.target"];};
};
};
}