refactor(treewide)
This commit is contained in:
parent
25d48ac2ac
commit
c4fc882042
99 changed files with 634 additions and 477 deletions
8
nixos/modules/gaming/default.nix
Normal file
8
nixos/modules/gaming/default.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
imports = [
|
||||
./steam.nix
|
||||
./gamemode.nix
|
||||
./gamescope.nix
|
||||
./openPorts.nix
|
||||
];
|
||||
}
|
||||
24
nixos/modules/gaming/gamemode.nix
Normal file
24
nixos/modules/gaming/gamemode.nix
Normal 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'";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
16
nixos/modules/gaming/gamescope.nix
Normal file
16
nixos/modules/gaming/gamescope.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
22
nixos/modules/gaming/openPorts.nix
Normal file
22
nixos/modules/gaming/openPorts.nix
Normal 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
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
35
nixos/modules/gaming/steam.nix
Normal file
35
nixos/modules/gaming/steam.nix
Normal 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 ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue