nixos-config/users/simon/modules/games.nix

55 lines
2.1 KiB
Nix
Raw Permalink Normal View History

# SPDX-FileCopyrightText: 2021-2024 Simon Bruder <simon@sbruder.de>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# Steam is installed as a flatpak,
# as this seems to be the only method that does not force me
# to spend hours debugging various issues with the client.
#
# Installation instructions for steam:
#
# 1. Run flatpak install flathub com.valvesoftware.Steam
# 2. Use Flatseal to revoke all filesystem permissions,
# development syscalls
# and bluetooth.
# 3. Add GDK_SCALE=2 as an environment variable (hack for sways Xwayland)
# 4. If you previously used steam-sandbox,
# you need to copy the files to the flatpak location.
# For this, start steam once (you can close it early),
# so it creates the new structure.
# Then, run the following commands:
# rm -rf ~/.var/app/com.valvesoftware.Steam/.local/share/Steam
# mv ~/.local/share/steam-sandbox/.local/share/Steam ~/.var/app/com.valvesoftware.Steam/.local/share/
# You might want to copy additional files of games,
# that do not store files inside of Steams directories.
# Afterwards, you can delete ~/.local/share/steam-sandbox
#
# For MangoHud, the following steps are also necessary:
# 1. Run flatpak install org.freedesktop.Platform.VulkanLayer.MangoHud
# 2. Add xdg-config/MangoHud:ro as filesystem mount to Steam in Flatseal
# 4. For Intel Arc systems,
# add /run/wrappers/bin/intel_gpu_top:ro as filiesystem mount
# and /run/wrappers/bin to the PATH environment variable in Flatseal
# 3. Add MANGOHUD=1 as a launch options to all games where MangoHud should be
# available
{ lib, nixosConfig, pkgs, ... }:
let
cfg = nixosConfig.sbruder.games;
inherit (nixosConfig.sbruder) unfree;
in
lib.mkIf cfg.enable {
home.packages = with pkgs; [
unstable.mangohud
] ++ lib.optionals (cfg.performanceIndex >= 2) [
2021-08-07 00:30:49 +02:00
mgba
] ++ lib.optionals (cfg.performanceIndex >= 4) [
desmume
2022-02-23 20:46:33 +01:00
unstable.dolphin-emu-beta
2023-08-04 22:31:21 +02:00
pcsx2
2022-08-16 00:27:01 +02:00
] ++ lib.optionals (cfg.performanceIndex >= 8) [
unstable.ryujinx
] ++ lib.optionals unfree.allowSoftware [
2021-10-04 16:33:40 +02:00
unstable.osu-lazer-sandbox
];
2021-01-07 18:29:18 +01:00
}