agentleFS
heytcassheytcass/claudeos/.claude/skills/deploy/SKILL.md

deploy

Skill1 starsChanged 17 days agoMITView on GitHub

Validate, land, and deploy NixOS configuration to a target host

155 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use pm-discovery, qa-phase and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ww-w-aiSkill

    pm-discovery

    PM Agent Team - Automated product discovery, strategy, and PRD generation. Runs PM analysis workflow to produce comprehensive PRD before PDCA Plan phase.

    Also in 3 projects that use this

  • ww-w-aiSkill

    qa-phase

    Run QA tests at various levels (L1-L5) for features under PDCA management. Integrates with MCP tools to execute structured test plans.

    Also in 3 projects that use this

  • +10 more from ww-w-ai

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 139 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    If no host specified, default to $(hostname) (current machine).

    line 20
  2. Distinctive:

    Commit with explicit paths (never git add -A), then from the worktree:

    line 50
  3. Very specific:

    Never deploy from a worktree (nixos-rebuild --flake <worktree>#…): the generation would run code main doesn't have, and the next host to …

    line 68
  4. Distinctive:

    After landing, a remote host deploys main the same way:

    line 74

“Common” is measured: kept by at least 6 in 10 of the 139 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Deploy NixOS Configuration

Full pipeline: validate → land on main → apply. A host only ever deploys main, from the shared checkout ~/.config/claudeos. Session work lives in its own worktree and reaches the host by landing (CLAUDE.md, "Workflow").

Usage

/deploy or /deploy <hostname>

Steps

1. Determine Target

If no host specified, default to $(hostname) (current machine). If deploying to a different host, confirm with user. List available hosts from hosts/ directory.

2. Validate (stages untracked files itself)

claudeos-validate is the canonical validation — it stages untracked files (flakes only see tracked ones), runs nix flake check, and dry-run-builds every host the flake defines. It validates the checkout you are standing in (your worktree), not the shared one:

claudeos-validate
nix fmt -- --ci .

Stop on failure. Fix before continuing.

--ci is the formatting gate, not --check — treefmt has no --check flag, so that spelling makes it print its help and exit 1 on every run, whether or not anything is misformatted. --ci implies --no-cache --fail-on-change: exit 0 when the tree is clean, 1 when a file would change. Read the N changed count in its output, not a piped $? — cmd | tail reports tail's status and will mask a real failure.

Hyprland config and Quickshell QML are invisible to both (CLAUDE.md, "Compositor config isn't validated by the build") — run hypr_config_check / quickshell_check (pass qml_dir = your worktree's home/quickshell) for anything that touched them.

3. Land and apply this host

Commit with explicit paths (never git add -A), then from the worktree:

claudeos-land

It rebases on origin/main, names the generation, pushes, opens or reuses the PR, waits for its required CI — flake-validate is the rung-4 gate, so land doesn't rerun claudeos-validate locally (about two minutes; a PR touching flake.lock, flake.nix or validate.yml also waits on lock-gate's gti build and VM boot), squash-merges it (only the exact validated head), fast-forwards ~/.config/claudeos, runs nixos-rebuild switch there for $(hostname) (scoped NOPASSWD — no prompt), and sweeps landed worktrees. Run it in the background; CI and the switch take minutes. --no-deploy stops after the merge.

It refuses — and says why — rather than deploy a half state: uncommitted changes in the worktree, a rebase conflict, failed required checks, a PR that won't merge, or uncommitted config in the shared checkout.

Never deploy from a worktree (nixos-rebuild --flake <worktree>#…): the generation would run code main doesn't have, and the next host to pull would silently drop it.

4. Other hosts

After landing, a remote host deploys main the same way:

ssh <hostname> "cd ~/.config/claudeos && git pull --ff-only && sudo nixos-rebuild switch --flake ~/.config/claudeos#\$(hostname)"

Confirm with the user first.

5. Verify

nixos-rebuild list-generations | head -3

Report the new generation number and its Configuration Revision. It should be the squash commit that landed; dirty means the shared checkout had uncommitted changes and the generation corresponds to nothing committed (flake.nix stamps self.shortRev or "dirty").

Then ask the user to verify the target functionality — prefer checking whatever the build could not.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.