feat(system): add gaming preset module

Opt-in `nomarchy.system.gaming.enable` (default false). Wires
`programs.steam` (with `remotePlay` and `localNetworkGameTransfers`
firewall holes opened via `mkDefault`), `programs.gamemode` (the
launching user must be in the `gamemode` group), and
`services.flatpak`.

Two pieces of the original roadmap entry split into separate
Next-column rows so the system-side preset ships now:

  1. Hyprland fullscreen-on-Steam-launch window rule (home-side).
  2. Declarative flathub remote (nixpkgs has no API for this; needs
     either an overlay or a one-shot systemd unit).

The flatpak service is enabled but the user must add flathub
manually after first boot — documented in OPTIONS.md.
This commit is contained in:
Bernardo Magri
2026-04-26 09:10:52 +01:00
parent 8266dc7ee2
commit 21ee9c6035
5 changed files with 40 additions and 1 deletions

View File

@@ -22,6 +22,7 @@
./laptop.nix
./desktop.nix
./accessibility.nix
./gaming.nix
./hibernate.nix
./containers.nix
./pam.nix

20
core/system/gaming.nix Normal file
View File

@@ -0,0 +1,20 @@
{ config, lib, ... }:
let
cfg = config.nomarchy.system.gaming;
in
{
config = lib.mkIf cfg.enable {
programs.steam = {
enable = true;
remotePlay.openFirewall = lib.mkDefault true;
localNetworkGameTransfers.openFirewall = lib.mkDefault true;
};
# gamemode adjusts CPU governor and reschedules processes when a
# game requests it. The launching user must be in the `gamemode` group.
programs.gamemode.enable = true;
services.flatpak.enable = true;
};
}

View File

@@ -145,6 +145,18 @@
};
};
gaming = {
enable = lib.mkEnableOption ''
Gaming preset: Steam (with remote-play firewall holes),
gamemode (CPU governor + nice on Steam launch via the user's
gamemode group), and flatpak. NOTE: flatpak's flathub remote
is not added declaratively after first boot, run
`flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo`.
The Hyprland fullscreen-on-Steam-launch window rule is a
separate roadmap item.
'';
};
containers = {
enable = lib.mkEnableOption ''
Rootless Podman with Docker compatibility (`docker` `podman`),