nixos/hosts/FredOS-Gaming.nix
2026-08-01 22:29:01 +01:00

119 lines
4.9 KiB
Nix

# hosts/FredOS-Gaming.nix
{ config, pkgs, lib, inputs, ... }:
{
config = lib.mkIf (config.networking.hostName == "FredOS-Gaming") {
environment.systemPackages = with pkgs; [
mangohud
gamescope
vesktop
lsfg-vk
lsfg-vk-ui
faugus-launcher
mission-center
vlc
gnome-text-editor
wowup-cf
proton-vpn
onlyoffice-desktopeditors
woeusb
qbittorrent
cmatrix
protonplus
];
programs.geary.enable = true;
# Nova Pro Wireless base station: open up its vendor HID interface so
# quickshell's ANC switcher can write to it directly (nova-anc script in
# settings/quickshell.nix). Single-user desktop, 0666 is fine.
services.udev.extraRules = ''
KERNEL=="hidraw*", ATTRS{idVendor}=="1038", ATTRS{idProduct}=="12e0", MODE="0666"
KERNEL=="hidraw*", ATTRS{idVendor}=="1038", ATTRS{idProduct}=="12e5", MODE="0666"
KERNEL=="hidraw*", ATTRS{idVendor}=="1038", ATTRS{idProduct}=="225d", MODE="0666"
'';
# Force heavy builds off the gaming PC onto the media server so nix updates
# never compete with games for CPU/RAM. Pairs with the distributed build
# config in common.nix. builders-use-substitutes lets the server pull from
# binary caches directly rather than re-uploading through this machine.
#
# max-jobs = 1 (not 0): trivial preferLocalBuild = true derivations (e.g.
# pkgs.writeText for HM config files) are rejected by the remote build hook
# and can't be substituted, so they must build locally. They finish in
# milliseconds and have no gaming impact. All real compilation still goes to
# the remote via the distributed build config.
nix.settings.max-jobs = 1;
nix.settings.builders-use-substitutes = true;
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
package = pkgs.steam.override {
extraPkgs = pkgs: with pkgs; [
adwaita-icon-theme
];
};
};
boot.loader.systemd-boot.configurationLimit = 5;
boot.initrd.systemd.enable = true;
# Early-console mode hint only (Hyprland sets the real mode at runtime via
# the desc-matched rule below). Connector name has drifted DP-2/DP-3.
boot.kernelParams = [ "video=DP-3:3440x1440@180" ];
# LAN has no IPv6 route — AAAA lookups succeed but connect fails, which
# made NetworkManager's connectivity probe report "limited" at boot
# (GNOME's "?" icon) until the next 5-min repoll.
#
# `enableIPv6 = false` only sets the system-wide sysctl; NetworkManager
# still flips disable_ipv6=0 on the live interface because each connection
# defaults to `ipv6.method = auto`. The probe then races over a SLAAC ULA
# that has no real upstream and we get the "?" again. Force every NM
# connection to skip v6 altogether and ignore router advertisements at
# the kernel layer for any future interface.
networking.enableIPv6 = false;
networking.networkmanager.connectionConfig."ipv6.method" = "disabled";
boot.kernel.sysctl = {
"net.ipv6.conf.all.accept_ra" = 0;
"net.ipv6.conf.default.accept_ra" = 0;
};
# NetworkManager only re-runs its connectivity probe on link-up or every
# 5 minutes. If the first boot probe races NM startup and reports
# "limited", GNOME caches that state until the next repoll — which is
# what surfaces as the persistent "?" icon. This oneshot kicks an
# explicit recheck once everything's online, which forces NM to
# transition to "full" and the icon clears.
systemd.services.nm-connectivity-kick = {
description = "Force NetworkManager connectivity recheck after boot";
after = [ "NetworkManager.service" "network-online.target" ];
wants = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.networkmanager}/bin/nmcli networking connectivity check";
};
};
home-manager.users.fred = { ... }: {
# Connector drifted DP-2 -> DP-3 after an HDMI detour; desc: matching
# parsed fine (configerrors ok) but never actually applied the mode,
# whereas plain connector-name matching is proven to hold 180Hz here.
wayland.windowManager.hyprland.settings.monitor = [{
output = "DP-3";
mode = "3440x1440@180";
position = "0x0";
scale = 1;
# G34WQCP is a wide-gamut VA panel (120% sRGB / 90% DCI-P3). Hyprland
# defaults to cm "srgb", i.e. no conversion, so sRGB content came out
# oversaturated. Clamp here rather than via the monitor's own sRGB OSD
# preset, which locks overdrive off — bad on VA. Panel is natively
# 8-bit, so no bitdepth override.
cm = "dcip3";
}];
home.file.".local/share/Steam/compatibilitytools.d/Proton-CachyOS Latest".source =
inputs.proton-cachyos-nix.packages.x86_64-linux.proton-cachyos-x86_64-v3.steamcompattool;
};
};
}