system: replace host detection with capabilities module
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:
@@ -113,6 +113,18 @@
|
||||
# ];
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
# Host capabilities
|
||||
host.capabilities = {
|
||||
hasCuda = true;
|
||||
hasBattery = false;
|
||||
formFactor = "desktop";
|
||||
volumeScrollStep = 5;
|
||||
enableArrhist = true;
|
||||
hasEduroamAccess = false;
|
||||
backupRepository = "rest:http://10.69.12.52:8000/gunter.home.2rjus.net";
|
||||
backupPassword = "gunter.home.2rjus.net";
|
||||
};
|
||||
|
||||
# Install system-wide packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
curl
|
||||
@@ -123,7 +135,7 @@
|
||||
wget
|
||||
v4l-utils
|
||||
nmap
|
||||
(lib.mkIf (config.system.name == "gunter") pciutils)
|
||||
pciutils
|
||||
|
||||
# X shit
|
||||
# xorg.xorgserver
|
||||
|
||||
@@ -44,6 +44,18 @@
|
||||
};
|
||||
};
|
||||
|
||||
# Host capabilities
|
||||
host.capabilities = {
|
||||
hasCuda = false;
|
||||
hasBattery = true;
|
||||
formFactor = "laptop";
|
||||
volumeScrollStep = 1;
|
||||
enableArrhist = false;
|
||||
hasEduroamAccess = true;
|
||||
backupRepository = null;
|
||||
backupPassword = null;
|
||||
};
|
||||
|
||||
# Bluetooth stuff
|
||||
services.blueman.enable = true;
|
||||
hardware.bluetooth.enable = true;
|
||||
|
||||
Reference in New Issue
Block a user