Two base roles: admin (full infrastructure control) and server (service-only, no GUI). The skeleton every host profile hangs on.
Role-based module definitions that provide a common baseline for different kinds of machines in the infrastructure.
| File | Purpose |
|---|---|
adm.nix |
Admin role β full tooling, SSH keys, sudo config, monitoring access, dev packages |
server.nix |
Server role β bare-bones, no GUI, only service packages, hardened networking |
| Directory | Contents |
|---|---|
.attic/ |
Previous role definitions, retired configurations |
Roles are composable baselines β they set defaults and capabilities but don't specify host identity. A complete config stacks a role on top of its host:
# In hosts/srv.nix
{ imports = [
../role/adm.nix # β Admin role (SSH keys, tooling, dev packages)
../role/server.nix # β Server role (services, networking)
];
}
# In hosts/srv2.nix
{ imports = [
../role/adm.nix # β Also an admin machine
../role/server.nix # β With extra GNOME desktop packages
];
}| Category | Contents |
|---|---|
| SSH | Host keys, authorized_keys, agent forwarding |
| Packages | All dev tools, editors, CLI tools, NixOS tooling |
| Sudo | Full sudoers config for infrastructure management |
| Monitoring | Prometheus, Grafana, dashboards |
| Shell | Zsh, starship prompt, aliases, tab-completion |
| Category | Contents |
|---|---|
| Services | Base service daemon configs |
| Networking | Hardened network defaults, firewall baseline |
| Logging | Log forwarding, journald config |
Think of roles as trait types in a type system: This makes it possible to mix and match different capability sets without duplicating configurations.