refactor(treewide)

This commit is contained in:
ooks-io 2024-06-11 22:37:17 +12:00
parent 25d48ac2ac
commit c4fc882042
99 changed files with 634 additions and 477 deletions

View file

@ -0,0 +1,8 @@
{
imports = [
./steam.nix
./gamemode.nix
./gamescope.nix
./openPorts.nix
];
}

View file

@ -0,0 +1,24 @@
{ lib, config, pkgs, ... }:
let
inherit (lib) mkIf;
cfg = config.ooknet.gaming.gamemode;
in
{
config = mkIf cfg.enable {
programs.gamemode = {
enable = true;
settings = {
general = {
renice = 15;
softrealtime = "auto";
};
custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'";
};
};
};
};
}

View file

@ -0,0 +1,16 @@
{ lib, config, pkgs, ... }:
let
inherit (lib) mkIf;
cfg = config.ooknet.gaming.gamescope;
in
{
config = mkIf cfg.enable {
hardware.opengl.extraPackages = [ pkgs.gamescope ];
programs.gamescope = {
enable = true;
capSysNice = true;
};
};
}

View file

@ -0,0 +1,22 @@
{ lib, config, ... }:
let
inherit (lib) mkIf;
cfg = config.ooknet.gaming.openPorts;
in
{
config = mkIf cfg.enable {
networking.firewall = {
allowedTCPPorts = [ 3074 ];
allowedUDPPorts = [
88
500
3074
2075
3544
4500
];
};
};
}

View file

@ -0,0 +1,35 @@
{ lib, config, pkgs, ... }:
let
inherit (lib) mkIf;
cfg = config.ooknet.gaming.steam;
steamFix = pkgs.steam.override {
extraPkgs = pkgs: with pkgs; [
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
mangohud
winetricks
protontricks
gtk3
gtk3-x11
];
};
in
{
config = mkIf cfg.enable {
programs.steam = {
enable = true;
package = steamFix;
extraCompatPackages = [ pkgs.proton-ge-bin.steamcompattool ];
};
};
}