ft (wip): big initial config

This commit is contained in:
2026-09-26 01:45:42 +02:00
parent 4aead77c60
commit 7a07c37bc3
19 changed files with 1173 additions and 0 deletions

21
hosts/tuxcomp/default.nix Normal file
View File

@@ -0,0 +1,21 @@
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
../../modules
./gaming.nix
];
# TODO: literally this whole configuration lmao
# adds a `stretch_aspect` scaler (Valve/gamescope#927) and lets `--rt` use the
# rtprio limit from modules/gaming.nix instead of CAP_SYS_NICE.
nixpkgs.overlays = [
(_final: prev: {
gamescope = prev.gamescope.overrideAttrs (old: {
patches = (old.patches or [ ]) ++ [ ../../patches/gamescope-stretch-aspect.patch ];
});
})
];
}

73
hosts/tuxcomp/gaming.nix Normal file
View File

@@ -0,0 +1,73 @@
{ pkgs, ... }:
{
programs.gamemode.enable = true;
users.users.djai.extraGroups = [ "gamemode" ];
# capSysNice would make glibc strip LD_PRELOAD from gamescope, breaking steam's overlay.
# '--rt' works through the rtprio limit below instead (see the gamescope patch on tuxcomp).
programs.gamescope = {
enable = true;
capSysNice = false;
};
security.pam.loginLimits = [
{
domain = "@users";
type = "-";
item = "rtprio";
value = "99";
}
{
domain = "@users";
type = "-";
item = "nice";
value = "-19";
}
];
# Wine 10+ uses the kernel's ntsync when /dev/ntsync exists; far cheaper
# than esync/fsync under thread contention.
boot.kernelModules = [ "ntsync" ];
users.users.djai.packages = with pkgs; [
desmume
eden
libretro.citra
prismlauncher
steam
winetricks
]:
services.flatpak.packages = [
"org.vinegarhq.Sober"
];
# TODO: switch to home manager
# home-manager.users.djai =
# { config, ... }:
# {
# home.packages = with pkgs; [ ];
#
# xdg.desktopEntries.sims4 = {
# name = "The Sims 4";
# exec = ''xdg-open "PATHTOEXECHERE"'';
# icon = "${config.home.homeDirectory}/.icons/";
# categories = [ "Game" ];
# terminal = false;
# };
#
# # gamescope does fullscreen and scaling; setting content=game sets direct scnaout
# # requires this in hyprland config: render.direct_scanout = 2;
# wayland.windowManager.hyprland.settings.window_rule = [
# {
# match.class = "gamescope";
# fullscreen = true;
# content = "game";
# opaque = true;
# immediate = true;
# }
# ];
# };
}