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

@@ -1,5 +0,0 @@
{ ... }:
{
# Browser is configured and managed via Home Manager (home/brave.nix)
}

View File

@@ -1,8 +1,8 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
vesktop
signal-desktop
];
environment.systemPackages = with pkgs; [
vesktop
signal-desktop
];
}

View File

@@ -3,9 +3,10 @@
{
imports = [
./terminal.nix
./browser.nix
./communication.nix
./dev.nix
./virt.nix
./gaming.nix
./local-ai.nix
];
}

View File

@@ -1,15 +1,22 @@
{ pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
config = lib.mkIf config.my.gaming.enable {
programs.steam = {
enable = true;
remotePlay.openFirewall = false;
dedicatedServer.openFirewall = false;
gamescopeSession.enable = false;
enable = true;
remotePlay.openFirewall = false;
dedicatedServer.openFirewall = false;
gamescopeSession.enable = false;
};
environment.systemPackages = with pkgs; [
mangohud
gamemode
mangohud
gamemode
];
};
}

45
modules/apps/local-ai.nix Normal file
View File

@@ -0,0 +1,45 @@
{
config,
lib,
pkgs,
inputs,
...
}:
{
imports = [
inputs.comfy-ui.nixosModules.default
];
config = lib.mkIf config.my.ai.local.enable {
services = {
comfyui = {
enable = true;
gpuSupport = "cuda";
enableManager = true;
port = 8188;
listenAddress = "0.0.0.0";
dataDir = "/var/lib/comfyui";
user = "comfyui";
group = "comfyui";
createUser = true;
};
ollama = {
enable = true;
package = pkgs.unstable.ollama-cuda;
host = "0.0.0.0";
port = 11434;
user = "ollama";
group = "ollama";
home = "/var/lib/ollama";
};
open-webui.enable = true;
};
environment.systemPackages = with pkgs; [
unstable.ollama-cuda
];
};
}

View File

@@ -1,37 +0,0 @@
{ pkgs, inputs, ... }:
{
imports = [
inputs.comfy-ui.nixosModules.default
];
services = {
comfyui = {
enable = true;
gpuSupport = "cuda";
enableManager = true;
port = 8188;
listenAddress = "0.0.0.0";
dataDir = "/var/lib/comfyui";
user = "comfyui";
group = "comfyui";
createUser = true;
};
ollama = {
enable = true;
package = pkgs.unstable.ollama-cuda;
host = "0.0.0.0";
port = 11434;
user = "ollama";
group = "ollama";
home = "/var/lib/ollama";
};
open-webui.enable = true;
};
environment.systemPackages = with pkgs; [
unstable.ollama-cuda
];
}

View File

@@ -1,9 +1,9 @@
{ pkgs, ... }:
{
# Terminal is managed elsewhere; system-level CLI helpers live here.
environment.systemPackages = with pkgs; [
zoxide
fzf
];
# Terminal is managed elsewhere; system-level CLI helpers live here.
environment.systemPackages = with pkgs; [
zoxide
fzf
];
}

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ config, pkgs, ... }:
{
virtualisation = {
@@ -27,7 +27,7 @@
programs.virt-manager.enable = true;
users.users.anish.extraGroups = [
users.users.${config.my.username}.extraGroups = [
"libvirtd"
"kvm"
"incus-admin"