system: replace host detection with capabilities module
All checks were successful
Run nix flake check / flake-check (push) Successful in 2m1s
Run nix flake check / flake-check (pull_request) Successful in 2m7s

Replace scattered osConfig.system.name comparisons with a declarative
host.capabilities module. This improves maintainability and semantic
clarity by expressing what capabilities a host has rather than checking
its name.

Changes:
- Add system/host-capabilities.nix with options for hardware, form factor,
  UI behavior, services, and backup configuration
- Configure capabilities in hosts/gunter and hosts/magicman
- Migrate 6 files to use capabilities: packages, waybar, ssh, backup-home
- Remove redundant host name check for pciutils in gunter config
- Make backup-home service conditionally enabled based on capabilities

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-31 10:16:19 +01:00
parent 60add5a8b0
commit b8e04eb338
8 changed files with 112 additions and 13 deletions

View File

@@ -14,8 +14,9 @@ let
dontUnpack = true;
installPhase = "install -Dm755 ${./arrhist.py} $out/bin/arrhist";
};
withArrhist = if (osConfig.system.name == "gunter") then true else false;
withBattery = if (osConfig.system.name == "magicman") then true else false;
cfg = osConfig.host.capabilities;
withArrhist = cfg.enableArrhist;
withBattery = cfg.hasBattery;
in
{
sops.secrets."sonarr_base_url" = { };
@@ -153,7 +154,7 @@ in
settings = [
(
let
volInterval = if (osConfig.system.name == "gunter") then "5" else "1";
volInterval = toString cfg.volumeScrollStep;
in
{
"layer" = "top";