Port the AMD, ROCm, gaming, VPN and Docker aspects; document the new secrets

Replace the T0 stubs with the old modules' behaviour, one aspect each:
- nixos.amd: graphics (32-bit), amdgpu (initrd, OpenCL, overdrive), microcode,
  kvm-amd, monitoring tools and LACT (the old default).
- nixos.rocm: rocminfo, rocm-smi and /opt/rocm/hip; the desktop host does not
  import it, as before.
- nixos.gaming: Steam, Proton-GE, gamescope (off), gamemode, MangoHud, the
  vm.max_map_count sysctl and the owner's `gamemode` group.
- nixos.vpn: AmneziaVPN and nm-applet; the OpenVPN plugin stays in
  core/networking.nix.
- nixos.docker: rootful and rootless Docker on btrfs and the owner's `docker`
  group.

secrets/secrets.nix gains the recipient entries for gitea-runner-token.age and
tg-ws-proxy-secret.age (additive). secrets/README.md documents both optional
secrets, the exact commands to create them from a pipe, and rotation, because
the old plaintext values are in the git history.

proxy-suite.nix, gitea-runner.nix, secrets.nix and ssh.nix were verified
against the old modules and need no change.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JZ16yf4acmaSiHq81vyQ6Z
This commit is contained in:
Claude committed 2026-10-12 21:09:41 +00:00
1 parent 6e2fa1b9e7
commit 0155afdad7
7 files changed
+176 -10

No files matched your search

+19 -2
View File
@@ -1,4 +1,21 @@
# STUB (T2): replaced in phase 2
# Docker: the rootful daemon (the Gitea Actions runner in dev/gitea-runner.nix
# runs its jobs on it) next to rootless Docker for the owner, on the btrfs
# storage driver. The owner joins the `docker` group.
{ config, ... }:
let
inherit (config.meta) owner;
in
{
flake.modules.nixos.docker = { };
flake.modules.nixos.docker = {
virtualisation.docker = {
enable = true;
rootless = {
enable = true;
setSocketVariable = true;
};
storageDriver = "btrfs";
};
users.users.${owner.name}.extraGroups = [ "docker" ];
};
}
+54 -2
View File
@@ -1,4 +1,56 @@
# STUB (T2): replaced in phase 2
# Steam + Proton, gamescope, gamemode and MangoHud. The owner joins the
# `gamemode` group (created by programs.gamemode) so gamemoderun may renice and
# tune the GPU.
{ config, ... }:
let
inherit (config.meta) owner;
in
{
flake.modules.nixos.gaming = { };
flake.modules.nixos.gaming =
{ pkgs, ... }:
{
programs = {
steam = {
enable = true;
remotePlay.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
dedicatedServer.openFirewall = false;
gamescopeSession.enable = true;
extraCompatPackages = [ pkgs.proton-ge-bin ];
protontricks.enable = true;
# Steam Input on Wayland (controllers acting as keyboard/mouse).
extest.enable = true;
};
gamescope = {
enable = false;
# Lets gamescope raise its own priority.
capSysNice = true;
};
gamemode = {
enable = true;
settings = {
general.renice = 10;
gpu = {
apply_gpu_optimisations = "accept-responsibility";
gpu_device = 0;
amd_performance_level = "high";
};
};
};
};
hardware.steam-hardware.enable = true;
environment.systemPackages = with pkgs; [
mangohud
protonplus
];
# Some Proton games exhaust the default map count and crash.
boot.kernel.sysctl."vm.max_map_count" = 2147483642;
users.users.${owner.name}.extraGroups = [ "gamemode" ];
};
}
+37 -2
View File
@@ -1,4 +1,39 @@
# STUB (T2): replaced in phase 2
# AMD CPU + Radeon GPU. The nixos-hardware profiles (common-cpu-amd, -pstate,
# -gpu-amd, -pc-ssd) are imported by the host (modules/hosts/<name>/hardware.nix);
# defaults that overlap use mkDefault. The ROCm/HIP compute stack is a separate
# aspect (hardware/rocm.nix).
{
flake.modules.nixos.amd = { };
flake.modules.nixos.amd =
{ lib, pkgs, ... }:
{
hardware = {
graphics = {
enable = true;
# Steam/Proton and Wine need the 32-bit Mesa drivers.
enable32Bit = true;
};
amdgpu = {
initrd.enable = lib.mkDefault true;
opencl.enable = true;
# LACT needs the overdrive bit in amdgpu.ppfeaturemask to tune clocks.
overdrive.enable = true;
};
cpu.amd.updateMicrocode = lib.mkDefault true;
};
boot.kernelModules = [ "kvm-amd" ];
# LACT: GPU monitoring, fan curves and overclocking.
services.lact.enable = true;
environment.systemPackages = with pkgs; [
vulkan-tools
mesa-demos
radeontop
nvtopPackages.amd
lm_sensors
];
};
}
+14 -2
View File
@@ -1,4 +1,16 @@
# STUB (T2): replaced in phase 2
# ROCm/HIP compute stack for AMD GPUs: rocminfo, rocm-smi and the /opt/rocm/hip
# link many HIP applications look for. Off by default: a host opts in by
# importing this aspect next to `amd` (the desktop host does not).
{
flake.modules.nixos.rocm = { };
flake.modules.nixos.rocm =
{ pkgs, ... }:
{
environment.systemPackages = with pkgs.rocmPackages; [
rocminfo
rocm-smi
];
# Many HIP applications look for the runtime in /opt/rocm/hip.
systemd.tmpfiles.rules = [ "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" ];
};
}
+7 -2
View File
@@ -1,4 +1,9 @@
# STUB (T2): replaced in phase 2
# VPN clients: AmneziaVPN and the NetworkManager tray applet. The OpenVPN plugin
# for NetworkManager comes with NetworkManager itself (core/networking.nix), so
# imported connections work with or without this aspect.
{
flake.modules.nixos.vpn = { };
flake.modules.nixos.vpn = {
programs.nm-applet.enable = true;
programs.amnezia-vpn.enable = true;
};
}