dotfiles/nixos
DannyDannyDanny 9921a7f9f1 feat(nix): zerotier overlay via clan inventory + mac ZT client 🕸️
Stage 4b of the clan migration. Declares a clan.inventory.instances.zerotier
instance with sunken-ship as controller and phantom-ship as peer (controller
is also listed as a peer so it joins its own network). Generates the network
ID, controller identity, and per-peer identities via `clan vars generate`;
all secrets are SOPS-encrypted to the user's age key and the per-machine
age keys.

- nixos/sops/ — clan-managed SOPS state (user + per-machine age keys).
- nixos/vars/ — shared + per-machine zerotier vars; *-identity-secret
  files are SOPS-encrypted, *.value files are plain public data.
- clan.core.networking.{targetHost,buildHost} = "danny@<host>" on both
  servers so `clan machines update` knows where to push and build.
- mac gets `zerotier-one` installed as a homebrew cask; authorization
  on the controller happens manually by node-ID in a follow-up step.

Known rough edges (to chase in later stages):
- zerotier-inventory-autoaccept.service races zerotierone.service on
  first activation (connection refused against the local API). Retrying
  the unit succeeds; clan upstream bug.
- Deployment must go through `clan machines update`, not plain
  nixos-rebuild, or the per-host SOPS age key isn't uploaded and
  zerotier-one can't decrypt its identity.
2026-04-19 14:43:29 +02:00
..
flake-modules feat(nix): zerotier overlay via clan inventory + mac ZT client 🕸️ 2026-04-19 14:43:29 +02:00
home/danny refactor(nix): migrate to flake-parts, drop specialArgs ♻️ 2026-04-18 17:00:19 +02:00
hosts feat(nix): zerotier overlay via clan inventory + mac ZT client 🕸️ 2026-04-19 14:43:29 +02:00
lib refactor(nix): dedupe home-manager wiring across hosts ♻️ 2026-04-18 17:20:51 +02:00
modules refactor(nix): auto-load flake-modules + extract shared dotfiles-rebuild 🌳 2026-04-18 18:00:54 +02:00
sops feat(nix): zerotier overlay via clan inventory + mac ZT client 🕸️ 2026-04-19 14:43:29 +02:00
vars feat(nix): zerotier overlay via clan inventory + mac ZT client 🕸️ 2026-04-19 14:43:29 +02:00
disko-server.nix Add NixOS server installer USB (disko LUKS + WiFi, hostname prompt) 2026-03-08 16:16:25 +01:00
fish.nix feat(macos): Alacritty follows system light/dark appearance 2026-03-23 19:16:05 +01:00
flake.lock feat(nix): bootstrap clan-core for sunken-ship + phantom-ship 🏴‍☠️ 2026-04-19 13:54:44 +02:00
flake.nix feat(nix): bootstrap clan-core for sunken-ship + phantom-ship 🏴‍☠️ 2026-04-19 13:54:44 +02:00
installer-iso.nix Add NixOS server installer USB (disko LUKS + WiFi, hostname prompt) 2026-03-08 16:16:25 +01:00
neovim.nix fix(neovim): set withRuby and withPython3 explicitly to false 🔇 2026-04-19 13:48:25 +02:00
ollama.nix feat: add ollama 💩 2025-10-26 19:48:17 +01:00
readme.md docs: update nixos/readme.md with current host targets 📝 2026-03-30 23:44:18 +02:00
server-configuration-with-flakes.nix Rename nixos-server to sunken-ship 2026-03-01 12:44:28 +01:00
server-install-configuration.nix Rename nixos-server to sunken-ship 2026-03-01 12:44:28 +01:00
wsl.conf chore: remove wsl.conf 2025-09-09 15:24:51 +02:00

NixOS flake

Rebuild from dotfiles dir:

# macOS
cd ~/dotfiles/nixos && darwin-rebuild switch --flake .

# WSL
sudo nixos-rebuild switch --flake ~/dotfiles/nixos#wsl

# sunken-ship (on server)
sudo nixos-rebuild switch --flake /etc/dotfiles/nixos#sunken-ship

Server (sunken-ship)

One-time bootstrap (no git until first rebuild):

nix run --extra-experimental-features "nix-command flakes" nixpkgs#git -- clone https://github.com/DannyDannyDanny/dotfiles.git /tmp/dotfiles
sudo mv /tmp/dotfiles /etc/dotfiles
sudo nixos-rebuild switch --flake /etc/dotfiles/nixos#sunken-ship --option accept-flake-config true

If the daemon doesn't have flakes: copy server-configuration-with-flakes.nix to /etc/nixos/configuration.nix, run sudo nixos-rebuild switch, then build and switch to the flake (see server-quickstart.md for SSH keys).

SSH keys (not in repo): scp ~/.ssh/*.pub danny@server:/tmp/, then on server mkdir -p ~/.ssh; cat /tmp/*.pub >> ~/.ssh/authorized_keys. See docs/ssh-and-secrets.md.

Timer: every 15 min the server pulls and rebuilds when main changes. Config: hosts/sunken-ship.nix, hosts/sunken-ship-hardware.nix.

No git in PATH: sudo nix run nixpkgs#git -- -C /etc/dotfiles pull origin main.