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,9 +1,10 @@
{ ... }:
{
imports = [
./system.nix
./users.nix
./nix.nix
];
imports = [
../options.nix
./system.nix
./users.nix
./nix.nix
];
}

View File

@@ -36,12 +36,16 @@
nixpkgs.config.allowUnfree = true;
# Single source of truth for overlays; the flake module imports only the
# modules and does not declare overlays itself.
nixpkgs.overlays = [
(final: prev: {
unstable = import inputs.nixpkgs-unstable {
inherit (prev) system;
inherit (prev) config;
system = final.stdenv.hostPlatform.system;
config = final.config;
};
})
inputs.antigravity.overlays.default
inputs.comfy-ui.overlays.default
];
}

View File

@@ -1,30 +1,30 @@
{ pkgs, ... }:
{ config, pkgs, ... }:
{
users.defaultUserShell = pkgs.zsh;
programs.zsh = {
enable = true;
loginShellInit = ''
if [ -z "$DISPLAY" ] && [ "$TTY" = "/dev/tty1" ]; then
exec start-hyprland
fi
'';
};
users.defaultUserShell = pkgs.zsh;
programs.zsh.enable = true;
users.users.anish = {
isNormalUser = true;
description = "Main Account";
extraGroups = [ "wheel" "networkmanager" "video" "audio" "gaming" "llm" ];
openssh.authorizedKeys.keys = [
# ssh-ed25519 AAAAA.... add my key here to enable ssh from another computer
];
};
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
users.users.${config.my.username} = {
isNormalUser = true;
description = "Main Account";
extraGroups = [
"wheel"
"networkmanager"
"video"
"audio"
"gaming"
"llm"
];
openssh.authorizedKeys.keys = [
# ssh-ed25519 AAAAA.... add my key here to enable ssh from another computer
];
};
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
}