refactor: make hosts declarative and consolidate shared config

- add my.username / my.gaming.enable / my.ai.local.enable options and
  gate optional app modules on them instead of per-host import lists
- move vendor-neutral hardware.graphics into modules/graphical, leaving
  only NVIDIA-specific drivers and env vars in modules/hardware/nvidia
- derive the primary user everywhere from my.username (users, getty,
  home-manager, tmpfiles)
- de-duplicate Hyprland autostart down to a single system loginShellInit
  using the start-hyprland wrapper
- consolidate all nixpkgs overlays into modules/core/nix.nix and use
  final.stdenv.hostPlatform.system
- make the zsh rebuild helper target $(hostname) instead of hardcoded hades
- add nixpkgs follows for nixos-hardware, pi and comfy-ui (single nixpkgs)
- add .gitignore and a nixfmt flake formatter; format all nix files
- remove empty browser.nix/display-configuration.nix and rename
  local_ai.nix -> local-ai.nix
- document the my.* toggles in the README
This commit is contained in:
2026-09-18 23:32:32 -07:00
parent 367e21ef95
commit 598a43eace
30 changed files with 1093 additions and 768 deletions

View File

@@ -11,18 +11,21 @@
inputs.disko.nixosModules.disko
./disko.nix
./hardware-configuration.nix
./display-configuration.nix
../../modules/hardware/nvidia.nix
../../modules/apps/gaming.nix
../../modules/apps/local_ai.nix
];
networking.hostName = "hades";
# Opt this machine into the shared optional feature modules.
my = {
gaming.enable = true;
ai.local.enable = true;
};
# ---------------------------------------------------------------------------
# Host display configuration (absorbed by home/hypr/hyprland.nix)
# ---------------------------------------------------------------------------
home-manager.users.anish.volt.monitors = [
home-manager.users.${config.my.username}.volt.monitors = [
{
# Samsung Odyssey Ark - matched by description so it survives port changes
output = "desc:Samsung Electric Company Odyssey Ark H1AK500000";
@@ -44,7 +47,7 @@
# Ensure /games directory is accessible by default user
systemd.tmpfiles.rules = [
"d /games 0755 anish users -"
"d /games 0755 ${config.my.username} users -"
];
powerManagement.cpuFreqGovernor = "performance";
@@ -58,7 +61,6 @@
};
environment.systemPackages = with pkgs; [
mangohud
nvtopPackages.nvidia
];
}

View File

@@ -14,7 +14,10 @@
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "fmask=0077" "dmask=0077" ];
mountOptions = [
"fmask=0077"
"dmask=0077"
];
};
};
root = {

View File

@@ -1,5 +0,0 @@
{ ... }:
{
# Host-specific display configurations can be placed here if needed.
}

View File

@@ -1,14 +1,27 @@
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "thunderbolt" "usbhid" "sd_mod" ];
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"thunderbolt"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];