Skip to content

feat(pins): sidecar pins + pinned-sweep CLI sweeping Hydra status - #260

Merged
cterence merged 2 commits into
mainfrom
vibe/pinned-sweep-cli
Oct 21, 2026
Merged

cterence merged 2 commits into
mainfrom
vibe/pinned-sweep-cli

Conversation

@cterence

Copy link
Copy Markdown
Owner

What

Replaces the # pin: comment format with a single source of truth and automates the whole pin lifecycle against Hydra.

Pins sidecar

  • modules/pins.nix — flake.pins with darwin/nixos classes, each pin { version, tracker, reason }. Machine-managed by the tool.
  • One overlay wired in system-minimal (darwin/nixos classes) feeds the pins to multiverse.lib.pinOverlay; modules just use pkgs.<pkg> and never mention pins. Home-manager follows via useGlobalPkgs.
  • desktop-apps.nix loses its pinOverlay blocks and pin comments.

pinned-sweep Go CLI (packages/pinned-sweep, stdlib only)

  • check — Hydra status (nixpkgs/unstable) per pin on the platform its class needs; --closure host=attr dry-runs a host closure and Hydra-checks the packages it would actually build (cache misses); --json verdict; --build-unknown fallback builds pins Hydra has no data on.
  • apply — drops pins green on every needed platform, pins red closure packages at their last good version (Hydra history walk), regenerates modules/pins.nix; --pr pushes pinned-sweep/sweep and opens/updates an automerge PR; --preview for a dry run.

Workflows

  • update-flake.yml gains sweep (Hydra check, parallel to the lockfile job) → conditional fallback (macOS runner only when Hydra-unknown pins exist) → apply (automerge PR, report to step summary). Runs on the same daily schedule/dispatch as the lock update.
  • build.yml eval job gates the build matrix: hard-fails before any host build when a cache-miss package is already failing on Hydra.
  • pinned-sweep.yml and sweep-comment.js deleted.

The loop

red on Hydra → gate blocks the wasted build, sweep auto-pins last-good → automerge → green. Later Hydra goes green → sweep auto-unpins → automerge.

Verified

  • go test (parser, emitter, merge, apply logic) — pass
  • nix flake check --all-systems — pass
  • nix eval .#darwinConfigurations.macbook.system.drvPath — pass
  • Live run: all 4 current pins report green on Hydra; apply correctly regenerates modules/pins.nix and unpins (tested locally, reverted — first CI run will open the real unpin PR)

Known limits

  • drv→attr mapping for the closure gate is heuristic; exotic attrs (python3Packages.*, scoped) are skipped rather than false-blocked
  • packages Hydra never builds rely on the conditional fallback build
  • pending Hydra evals delay unpinning by one run

cterence and others added 2 commits October 21, 2026 20:52
Replace the # pin: comment format with a single source of truth in
modules/pins.nix (flake.pins), applied by one sidecar overlay wired in
system-minimal so modules never mention pins.

New pinned-sweep Go CLI (packages/pinned-sweep):
- check: Hydra status per pin + optional host-closure gate
- apply: drops green pins, pins red closure packages at last good
  version, optionally opens an automerge PR

update-flake.yml gains sweep/fallback/apply jobs running alongside the
lockfile job; build.yml's eval job gates the build matrix on
Hydra-failed closure packages. pinned-sweep.yml and sweep-comment.js
are deleted.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Everything after -- goes to the tool, so --option access-tokens landed
in the tool's flag parser and exited 2. Verified ordering locally.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
@cterence
cterence merged commit eccba37 into main Oct 21, 2026
4 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

homelab2

Build homelab2

/nix/store/mhphnw4gjfimcgd78h9afayh6xb92z7z-nixos-system-homelab2-26.11.20261020.02c087f

Closures difference

No changes found

@github-actions

Copy link
Copy Markdown
Contributor

macbook

Build macbook

/nix/store/k02y1b3hram777bilkccpmybllkr8cd2-darwin-system-26.11.f0ec2b3

Closures difference

No changes found

@github-actions

Copy link
Copy Markdown
Contributor

stronghold

Build stronghold

/nix/store/1dryg1l196pkachv5xmk29b5nfi2wjvr-nixos-system-stronghold-26.11.20261020.02c087f

Closures difference

No changes found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant