Repository navigation
Expand file tree
/
Copy pathgaming.nix
More file actions
80 lines (73 loc) · 2.68 KB
/
Copy pathgaming.nix
File metadata and controls
80 lines (73 loc) · 2.68 KB
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
# The user half of the gaming role. The system half -- the Steam module and
# 32-bit graphics support -- is in modules/nixos/gaming.nix.
{ config, lib, pkgs, ... }:
let
cfg = config.maxdeviant;
# RuneLite is too small to read on nokron's 4K panels without this.
#
# The Jagex Launcher passes the session to RuneLite through `JX_*`
# environment variables. It also leaks its own `APPIMAGE` variable, which
# RuneLite takes to mean that it's an AppImage itself and tries to relaunch
# the client through, so that has to go.
runelite = pkgs.symlinkJoin {
name = "runelite-wrapped";
paths = [ pkgs.runelite ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/runelite \
--set GDK_SCALE 2 \
--unset APPIMAGE \
--unset APPDIR
'';
};
in
{
config = lib.mkIf cfg.roles.gaming {
home.packages = with pkgs; [
# Upstream only supports the Flatpak and nags about any other packaging;
# the nixpkgs FHS wrapper works fine, so turn the nag off. Battle.net
# runs in here; the manual setup is in docs/battle-net.md.
(bottles.override { removeWarningPopup = true; })
(callPackage ../../pkgs/jagex-launcher.nix { })
lutris
runelite
wine
];
# The Jagex Launcher downloads RuneLite's generic Linux AppImage to this
# path, which can't run on NixOS, so put our RuneLite there instead. The
# launcher only downloads it when nothing is there, so it leaves this
# alone. See docs/runelite.md.
xdg.dataFile."Jagex Launcher/games/runelite/RuneLite.AppImage".source =
"${runelite}/bin/runelite";
# An in-game overlay for frame rate, frame times, and GPU/CPU stats. It
# only hooks games launched through it, so nothing shows by default: add
# `mangohud %command%` to a game's Steam launch options. Right Shift+F12
# toggles the overlay once it's running.
programs.mangohud = {
enable = true;
settings = {
# A frame time graph shows stutter that an FPS average hides.
fps = true;
frametime = true;
frame_timing = true;
# Clock and power next to load, since load alone can't tell a busy
# GPU from one idling at a low clock.
gpu_stats = true;
gpu_core_clock = true;
gpu_power = true;
gpu_temp = true;
vram = true;
gpu_name = true;
cpu_stats = true;
cpu_mhz = true;
cpu_temp = true;
ram = true;
# Which translation layer (DXVK, VKD3D-Proton, or native) the game is
# on, and at what resolution.
engine_version = true;
vulkan_driver = true;
resolution = true;
};
};
};
}