| name | new-host |
| description | Add a new NixOS or Darwin host to the repository. |
Add New Host
Step 1: Gather Requirements
Ask the user:
| Question | Options |
|---|
| Platform | nixos or darwin |
| Hostname | Genshin character (lowercase, e.g., nahida, furina) |
| Architecture | NixOS: x86_64-linux, aarch64-linux / Darwin: aarch64-darwin, x86_64-darwin |
| Type (NixOS only) | bare-metal, vm, container, wsl |
Step 2: Run Bootstrap Script
./new-host.sh <platform> <hostname> <arch> [type]
Examples:
./new-host.sh nixos wanderer x86_64-linux wsl
./new-host.sh darwin keqing aarch64-darwin
Step 3: Customize Configuration
Edit hosts/<platform>/<hostname>/system.nix:
NixOS Specifics
- Bare metal/VM: Generate hardware config with
nixos-generate-config --show-hardware-config
- Secrets access: Add SSH pubkey to
secrets/pubkeys.nix, then agenix -r
- Impermanence: Set
codgician.system.impermanence.enable = true
Darwin Specifics
- Homebrew casks: Add to
codgician.system.brew.casks
- App Store apps: Find IDs with
mas search "App Name", add to masApps
Step 4: Validate & Build
nix fmt
nix flake check
nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel
nix build .#darwinConfigurations.<hostname>.system
Step 5: Deploy (User Approval Required)
NixOS
nixos-rebuild switch --flake .#<hostname> --target-host <hostname> --use-remote-sudo
Darwin (first time)
./result/sw/bin/darwin-rebuild switch --flake .
Exit Criteria