···2525- **Tor**: Anonymous network access
26262727### Module System
2828-- `2configs/`: Main configuration modules (imported by all machines)
2828+- `2configs/`: Main configuration modules
2929+- `2configs/default.nix`: imported by all machines
2930- `3modules/`: Custom NixOS module definitions
3031- Stockholm modules are also imported for krebs infrastructure
3132···3536# Enter development shell
3637nix develop
37383838-# Run interactive menu (default package)
3939-nix run
4040-4139# Deploy to a specific machine
4242-nix run .#deploy -- <MACHINE_NAME>
4040+clan machines update <MACHINE_NAME>
43414442# Format code
4543nix fmt
···64626563**CRITICAL**: New nix files must be staged (git add) before they are available in flake evaluation. When creating new packages, modules, or any nix files, always run `git add <files>` before testing with `nix build`, `nix run`, etc.
66646767-## Machine Facts and Secrets
6565+## Machine Facts and Secrets via vars
68666969-Each machine stores its public facts in `machines/<name>/facts/` including:
7067- SSH public keys
7168- Network identities (retiolum, mycelium, zerotier)
7269- Syncthing IDs
7370- DKIM keys (for mail servers)
74717575-Secrets are managed via password-store and uploaded to `/etc/secrets` on deployment.
7272+Secrets are managed via password-store and uploaded to `/run/secrets` on deployment.
76737774## Adding New Machines
7875···81783. Generate facts using clan-cli
82794. Add to inventory in `flake.nix`
83805. Deploy using `nix run .#deploy -- <name>`
8484-8585-## Testing
8686-8787-- VM tests: `./5pkgs/init/test.sh`
8888-- Container tests are configured in `2configs/container-tests.nix`
89819082## Commit Message Guidelines
9183
-34
test.md
···11-22-## Overview
33-44-This guide explains how to set up and manage a [ZeroTier VPN](https://zerotier.com) for a clan network. Each VPN requires a single controller and can support multiple peers and optional moons for better connectivity.
55-66-## Roles
77-88-### 1. Controller
99-1010-The [Controller](https://docs.zerotier.com/controller/) manages network membership and is responsible for admitting new peers.
1111-When a new node is added to the clan, the controller must be updated to ensure it has the latest member list.
1212-1313-- **Key Points:**
1414- - Must be online to admit new machines to the VPN.
1515- - Existing nodes can continue to communicate even when the controller is offline.
1616-1717-### 2. Moons
1818-1919-[Moons](https://docs.zerotier.com/roots) act as relay nodes,
2020-providing direct connectivity to peers via their public IP addresses.
2121-They enable devices that are not publicly reachable to join the VPN by routing through these nodes.
2222-2323-- **Configuration Notes:**
2424- - Each moon must define its public IP address.
2525- - Ensures connectivity for devices behind NAT or restrictive firewalls.
2626-2727-### 3. Peers
2828-2929-Peers are standard nodes in the VPN.
3030-They connect to other peers, moons, and the controller as needed.
3131-3232-- **Purpose:**
3333- - General role for all machines that are neither controllers nor moons.
3434- - Ideal for most clan members' devices.