Modular config for my system and HA k3s cluster
| .forgejo/workflows | ||
| hosts | ||
| infra | ||
| modules | ||
| utils | ||
| .envrc | ||
| .gitignore | ||
| configuration.nix | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| README.md | ||
🐧 Modular NixOS Configuration
This repository uses a modular structure for managing NixOS and Home Manager configurations with support for multiple hosts and users.
📁 Project Structure
-
./configuration.nixMain entrypoint for defining:- Hosts and users
- Flake output generation
- Cross-cutting system & user settings (e.g. shells)
-
./hosts/${hostname}/default.nixHost-specific NixOS system settings -
./hosts/${hostname}/users/${username}/default.nixUser-specific settings under each host
🚀 Usage
🖥️ Create a New Host
mkHost
Creates a new host scaffold under ./hosts.
👤 Create a New User
mkUser
Adds a new user configuration under the given host directory.
⚙️ Configure a Host
Edit your configuration.nix found at root level of repository and add a host
definition:
{ ... }: {
hosts.my_hostname = {
arch = "x86_64-linux";
type = "desktop";
platform = "nixos";
users = {
my_user = {
root.enable = true;
shell = "zsh";
};
};
};
}
☁️ Remote Installation (Terraform)
Deploy with Terraform
Initialize and apply the Terraform setup for provisioning:
terraform init
terraform apply