blob: 36f2db5a519556614128d129136b86cc19717b2f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
{
config,
lib,
pkgs,
username,
inputs,
...
}:
let
cfg = config.os.srv.gaming;
in
{
options.os.srv.gaming = {
enable = lib.mkEnableOption "enables general gaming support";
tools.enable = lib.mkEnableOption "enables performance tools" // {
default = cfg.enable;
};
launchers.enable = lib.mkEnableOption "enables 3rd party launchers" // {
default = cfg.enable;
};
games.enable = lib.mkEnableOption "enables specific native games";
steam = {
enable = lib.mkEnableOption "enables the steam launcher";
enableSls = lib.mkEnableOption "enables the SLS Steam library modification";
};
vr.enable = lib.mkEnableOption "enables vr support";
};
config = lib.mkMerge [
# --- PERFORMANCE & TOOLING ---
(lib.mkIf cfg.tools.enable {
programs.gamescope = {
enable = true;
capSysNice = true;
};
programs.gamemode = {
enable = true;
enableRenice = true;
settings = {
general.renice = 10;
};
};
environment = {
# sets the optiscaler shortcut key to be home by default
sessionVariables = {
OPTISCALER_ShortcutKey = "0x24";
};
systemPackages = with pkgs; [
mangohud
theclicker
ludusavi
protonplus
];
};
})
# --- EXTERNAL LAUNCHERS ---
(lib.mkIf cfg.launchers.enable {
environment.systemPackages = with pkgs; [
heroic
# (pkgs.bottles.override { removeWarningPopup = true; })
(prismlauncher.override {
additionalLibs = with pkgs; [ ocl-icd ];
jdks = with pkgs; [ javaPackages.compiler.temurin-bin.jdk-25 ];
})
];
})
# --- SPECIFIC GAMES ---
(lib.mkIf cfg.games.enable {
environment.systemPackages = with inputs.openmw-nix.packages.${pkgs.stdenv.hostPlatform.system}; [
(pkgs.openttd-jgrpp)
# OpenMW Specific
(pkgs.openmw)
(pkgs.tes3cmd)
delta-plugin
groundcoverify
momw-configurator
openmw-validator
s3lightfixes
umo
];
})
# --- STEAM ---
(lib.mkIf cfg.steam.enable (
lib.mkMerge [
{
programs.steam = {
enable = true;
localNetworkGameTransfers.openFirewall = true;
dedicatedServer.openFirewall = true;
remotePlay.openFirewall = false;
extest.enable = true;
protontricks.enable = true;
};
environment.systemPackages = with pkgs; [ steamtinkerlaunch ];
}
(lib.mkIf cfg.steam.enableSls {
home-manager.users.${username} = {
imports = [ inputs.sls-steam.homeModules.sls-steam ];
services.sls-steam.config = {
PlayNotOwnedGames = true;
DisableFamilyShareLock = true;
SafeMode = false;
AdditionalApps = [
2483190
4439260
4439270
4439280
4439300
4439750
4439790
4439800
4439810
4439820
4439830
4440380
4444140
4444150
4520350
4520360
4562050
];
};
home.packages = [ inputs.sls-steam.packages.${pkgs.stdenv.hostPlatform.system}.wrapped ];
xdg.desktopEntries = {
steam = {
name = "Steam";
comment = "Library modified Steam client";
exec = "${
lib.getExe' inputs.sls-steam.packages.${pkgs.stdenv.hostPlatform.system}.wrapped "SLSsteam"
} %U";
icon = "steam";
terminal = false;
type = "Application";
categories = [
"Game"
"Utility"
];
mimeType = [ "x-scheme-handler/steamcmd" ];
};
};
};
})
]
))
# --- VR SUPPORT ---
(lib.mkIf cfg.vr.enable {
services.wivrn = {
enable = true;
openFirewall = true;
highPriority = true;
steam.importOXRRuntimes = true;
# defaultRuntime = true;
};
environment.systemPackages = [ pkgs.android-tools ];
users.users.${username}.extraGroups = [ "adbusers" ];
})
];
}
|