This repo is structured to keep machine-wide (system) configuration separate from user-level (home) configuration, while still allowing host-specific overrides.
High-level rule of thumb:
- NixOS (system): anything that affects the whole machine (services, drivers, desktop, system packages, users/groups, hardware).
- Home Manager (user): anything that lives in
$HOME(shell config, git config, CLI toolbox, per-user app settings).
Per-machine configuration. Each host gets its own directory.
hosts/nomad/configuration.nixHost-specific NixOS settings (hostname, networking quirks, device-specific settings, host-specific enables/disables, etc.).hosts/nomad/hardware-configuration.nixHardware autodetected config generated by NixOS (filesystems, initrd modules, etc.). Treat this as host-specific and avoid “hand-tuning” unless you know why.
Add a new machine by creating hosts/<hostname>/{configuration.nix,hardware-configuration.nix} and adding it to flake.nix under nixosConfigurations.
Reusable NixOS modules that define “roles” or “shared machine behavior”.
modules/common.nixShared system defaults used by all hosts (time zone, locale, nix settings, common services, etc.).modules/desktop-kde.nixDesktop role module (KDE + display manager + desktop services).modules/packages.nix(SYSTEM packages) Machine-wide packages: think GUI apps, admin tools, workstation-wide utilities. Use this for packages that should exist regardless of which user is logged in.Good examples:
- GUI apps you want available system-wide (CAD tools, IDEs, emulators)
- System/admin tooling (things you might want available in root contexts)
- Hardware/programmer tools you want on the whole machine
Try not to put “my personal CLI toolbox” here—put that in Home Manager.
modules/user-angelo.nix(SYSTEM user account) Defines the user account (groups, sudo/wheel access, etc.). Keep this file focused on account creation + group membership. Avoid personal dotfiles or large per-user package lists here; those belong in Home Manager.
Home Manager configs. Everything here is user-scoped and intended to be reproducible across machines.
home/angelo/default.nixEntry point for Angelo’s Home Manager config. Imports the rest of the user modules.home/angelo/packages.nix(USER packages) Angelo’s CLI/dev toolbox (per-user packages). Use this for tools you want as part of your everyday environment:- CLI utilities (rg, fd, jq, curl, htop, etc.)
- Dev tools (uv, gh, language runtimes, formatters, linters)
- Things that primarily operate in $HOME or your project dirs
This complements
modules/packages.nix:modules/packages.nix= machine-wide / GUI / admin toolshome/angelo/packages.nix= personal CLI/dev toolbox
home/angelo/git.nixGit configuration (name/email, aliases, line ending policy, defaults). No secrets should be committed here.home/angelo/direnv.nixEnables direnv + nix-direnv for “auto enter devshell” workflows. Typical project pattern: an.envrccontaininguse flake.home/angelo/bash.nixBash setup: aliases, prompt tweaks, environment variables, completion.home/angelo/shell.nixOptional “shell-agnostic” settings. If unused or duplicated withbash.nix, consider consolidating.
flake.nix/flake.lockMain entry point. Wires together:- the NixOS system modules (
/modules) - each host under
/hosts - Home Manager for the user under
/home
- the NixOS system modules (
configuration.nix/hardware-configuration.nix(top-level) Often leftover from pre-flake setups. If nothing imports these, they’re redundant and can be removed or kept only for reference.
From /etc/nixos:
sudo nixos-rebuild switch --flake /etc/nixos#nomadThis applies:
- NixOS system changes (modules + host config)
- Home Manager changes for Angelo (because HM is integrated as a NixOS module)
nix flake update
sudo nixos-rebuild switch --flake /etc/nixos#nomadGit may read both $HOME/.gitconfig and $XDG_CONFIG_HOME/git/config.
Home Manager usually manages the XDG one.
git config --show-origin --list | head -n 50
git config --show-origin --get-regexp '^alias\.'- Put “this machine needs X” in
/modules(system). - Put “I, Angelo, prefer X” in
/home/angelo(user). - Avoid putting credentials/tokens into Nix files. Manage those interactively (e.g. gh auth login).
- Keep
/hosts/<name>/hardware-configuration.nixhost-specific and minimal.
- Add
home/angelo/vscode.nix(settings + a core extension list) - Add
home/angelo/ssh.nix(safe ssh config, no private keys) - Split
/modules/packages.nixinto role-based modules if it grows (e.g.modules/cad.nix,modules/gaming.nix)