Command Palette

Search for a command to run...

Назад к скиллам
скилл № 84619

deploy

Deploy the NixOS/darwin fleet from main with nh. Use for any fleet deploy, host reboot, or post-deploy verification in this repo.

БесплатноБез исполняемых скриптов
kradalbyот kradalby★ 36 звёзд на GitHub

Установить deploy в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Deploy the fleet

Scope

Deploy THIS repo to the hosts declared in flake.nix / machines/. Do not write features, do not open PRs, do not deploy another repo. A host not in machines/ is out of scope — say so and stop. One host per deploy.

<target> below is the host's tailnet name, the dotted name with - for . (core.oracldn → core-oracldn). nh picks the nixosConfigurations entry named after --target-host, and the flake carries a dot-free copy of every host for garnix, so no -H is needed. Pass -H <node> only when the target is an IP (first deploy, before the host joins tailscale).

nh quick reference

Run from the repo root, as kradalby, inside the devShell (direnv). . is the flake. Everything after -- goes to nix build.

Task Command
Preview a host (copies closure, activates nothing) nh os dry-activate . --target-host root@<target>
Live switch a remote host nh os switch . --target-host root@<target>
Arm next boot, no unit touched nh os boot . --target-host root@<target>
Build on the target itself (gigabuilder) add --build-host root@gigabuilder
Bootstrap by IP nh os switch . -H <node> --target-host root@<ip>
dev.ldn (local) nh os switch . -H dev.ldn
Mac (on the Mac) nh darwin switch . -H <host>
Mac → remote, build on dev.ldn rnb --auto -- nh os switch . --target-host root@<target>
Fresh cache answers append -- --option narinfo-cache-negative-ttl 0
Generations on a host ssh root@<target> nixos-rebuild list-generations

Builds run on the deploying machine (dev.ldn) and fetch from tsnixcache (priority 30) and cachix first, via nix.settings.substituters. Fleet hosts have max-jobs = 0 and never build, except buildOnTarget hosts (dev.ldn, gigabuilder). There is no fleet-wide command: deploy host by host in the Order below.

Preconditions

nh in this devShell is wrapped: os|darwin|home switch|boot|test refuse unless the repo is on main, clean, in sync with origin, and has nothing unpushed. If it refuses, report the message and stop. Do not commit, push, checkout, stash or fetch to make it pass — that is the human's call. git-ready runs the same check on demand. The wrapper also adds --use-substitutes whenever --target-host is set, so the target pulls from tsnixcache and cachix instead of receiving the whole closure from here.

Never build closures locally — no nix flake check, nh os build or cache-arm. CI builds every host; a deploy only substitutes. CI is two systems, and both must be green for HEAD:

curl -s "http://garnixlogs/$(git rev-parse HEAD)"     # x86: fail=0 pend=0
gh run list --workflow cache-hosts.yml --limit 1 \
  --json headSha,status,conclusion                    # arm64

garnix has no aarch64 hardware, so garnix.yaml excludes the arm hosts and cache-hosts.yml builds them on GitHub runners and pushes to tsnixcache. Until that run is completed success for HEAD, arm hosts are not deployable.

Preview

Present the plan and get approval before Execute. The plan is built from evidence, not guesses:

ssh root@<node> nixos-version --json | jq -r .configurationRevision
git log --oneline <that rev>..HEAD
nh os dry-activate . --target-host root@<target> -- --option narinfo-cache-negative-ttl 0

The commit range is what is actually landing. A host tens of commits behind is not a one-service deploy — it lands the whole backlog, including deliberate deletions made months ago.

dry-activate builds, copies the closure and prints which units the switch would stop, restart and reload; it activates nothing. That list picks the method per host (see Execute). Any building '…' line for a real package is a cache miss — stop it and find out why rather than let dev.ldn build it, under emulation for arm. narinfo-cache-negative-ttl 0 matters: without it dev.ldn reuses a "not in cache" answer cached before CI finished pushing, for up to an hour, and builds what tsnixcache already has.

Execute

One host at a time. Wait for Verify to pass before starting the next.

Pick the method from the host's dry-activate output:

  • tailscaled (or systemd-networkd) not in the stop/restart list — live nh os switch . --target-host root@<target> -- --option narinfo-cache-negative-ttl 0. No reboot; a kernel change waits in the boot entry for a later on
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл deploy?

Deploy the NixOS/darwin fleet from main with nh. Use for any fleet deploy, host reboot, or post-deploy verification in this repo.

Как установить скилл deploy?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл deploy запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить deploy с