docs/nixpkgs: Expand the upgrade procedure
Add the review and bookkeeping the last upgrade needed: - Keep a progress document in the workspace, out of the upgrade's commits, and delete it at wrap-up after moving open follow-ups to TODOs, box pages or commit messages. - Check the published stable release rather than the newest release branch, and fetch the upstream branches explicitly. - Verify requested backports on each rebase base and compare both fork patch stacks with `git range-diff` before pushing. - Review the apps and services each channel supplies, and every direct flake input, for removals, migrations and breaking changes. - Present channel moves and migrations as choices, and mark any temporary pin with a TODO naming its exit condition. - Commit the refresh apart from procedure changes and service migrations, and list notable version upgrades in its description. Default the fork checkout to `../nixpkgs` and update the `upgrade-nixpkgs` skill to match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f5ef9031a6
commit
a3d4918095
2 files changed
+115
-30
No files matched your search
@@ -3,9 +3,9 @@ name: upgrade-nixpkgs
|
|||||||
description: >-
|
description: >-
|
||||||
Upgrade all four nixpkgs channels (unstable, stable, mine, mine-stable) and home-manager for this
|
Upgrade all four nixpkgs channels (unstable, stable, mine, mine-stable) and home-manager for this
|
||||||
flake: check for a NixOS stable bump, rebase the devplayer0 nixpkgs fork, update kernel and
|
flake: check for a NixOS stable bump, rebase the devplayer0 nixpkgs fork, update kernel and
|
||||||
release metadata, refresh pins, sweep version-gated TODOs, and review other inputs. Use when the
|
release metadata, refresh pins, sweep version-gated TODOs, and review compatibility of nixpkgs
|
||||||
user wants to update/bump nixpkgs, refresh the pins, or do the periodic nixpkgs/home-manager
|
apps and services and other flake inputs. Use when the user wants to update/bump nixpkgs,
|
||||||
upgrade.
|
refresh the pins, or do the periodic nixpkgs/home-manager upgrade.
|
||||||
---
|
---
|
||||||
|
|
||||||
# Upgrade nixpkgs
|
# Upgrade nixpkgs
|
||||||
@@ -15,19 +15,37 @@ follow its phases in order.
|
|||||||
|
|
||||||
Key reminders (see the doc for the full steps):
|
Key reminders (see the doc for the full steps):
|
||||||
|
|
||||||
|
- Read and update the progress document, `docs/nixpkgs-upgrade-progress.md`, as you work.
|
||||||
|
On resume, reconcile it with the working copy and remote refs. Record what was reviewed,
|
||||||
|
what was approved, the reason and exit condition for each workaround, and the next open step.
|
||||||
|
Keep it out of the upgrade's commits. At wrap-up, move open follow-ups to TODOs, box pages or
|
||||||
|
commit messages, then delete it.
|
||||||
|
- Commit the pin and input refresh separately from procedure changes and from each service
|
||||||
|
migration, and list the notable version upgrades in the refresh's description.
|
||||||
- It is **guided, not automated** — do the mechanical and investigative work but stop at the ⏸
|
- It is **guided, not automated** — do the mechanical and investigative work but stop at the ⏸
|
||||||
points: pushing the fork, resolving rebase conflicts, applying a stable-channel bump, choosing a
|
points: pushing the fork, resolving rebase conflicts, applying a stable-channel bump, choosing a
|
||||||
new release codename, and deleting version guards. Report the findings and let the user decide.
|
new release codename, deleting version guards, and choosing how to handle service compatibility
|
||||||
|
blockers. Present channel moves and migrations as choices before making either change.
|
||||||
|
If a temporary pin is chosen, add a TODO for the deferred migration.
|
||||||
- **Check the current NixOS stable first** (Phase 1) — the fork's `devplayer0-stable` rebase target
|
- **Check the current NixOS stable first** (Phase 1) — the fork's `devplayer0-stable` rebase target
|
||||||
and the `flake.nix` stable pins must agree on one release.
|
and the `flake.nix` stable pins must agree on one release.
|
||||||
- **Re-verify the patch stack against freshly fetched upstream**, not stale refs — enumerate it with
|
- Use `../nixpkgs` relative to this flake's root as the default checkout of the
|
||||||
`git log`; don't assume a remembered list.
|
`devplayer0/nixpkgs` fork.
|
||||||
|
- **Fetch the upstream branches explicitly** and re-verify the fork patch stack with `git log`.
|
||||||
|
Check for requested backports on each rebase base before cherry-picking them.
|
||||||
|
Compare both patch stacks with `git range-diff` and summarize the changes before asking to push.
|
||||||
- After pushing the rebased fork branches, **wait for the GitHub mirror to catch up** before
|
- After pushing the rebased fork branches, **wait for the GitHub mirror to catch up** before
|
||||||
refreshing flake pins. The `nixpkgs-mine*` inputs fetch from GitHub, not the fork's primary
|
refreshing flake pins. The `nixpkgs-mine*` inputs fetch from GitHub, not the fork's primary
|
||||||
remote; verify both GitHub branch tips match the pushed local tips first.
|
remote; verify both GitHub branch tips match the pushed local tips first.
|
||||||
- After refreshing the pins, update `lib/constants.nix` to the current explicit LTS and latest
|
- After refreshing the pins, update `lib/constants.nix` to the current explicit LTS and latest
|
||||||
kernel package attributes, and update the `lib/default.nix` version overlay's `YY.MM` prefix to
|
kernel package attributes, and update the `lib/default.nix` version overlay's `YY.MM` prefix to
|
||||||
the current month. Change its codename only when the stable channel advances.
|
the current month. Change its codename only when the stable channel advances.
|
||||||
|
- Review the apps and services supplied by each nixpkgs channel in use (Phase 3). Compare the old
|
||||||
|
and candidate versions and module options, and check release notes for removals, changed defaults,
|
||||||
|
compatibility with persisted data, and migrations that evaluation may miss.
|
||||||
|
- Compare each direct flake input's pin with its candidate for fixes and breaking changes.
|
||||||
|
Include the refreshes in the main upgrade. Ask before changing the release track, moving an
|
||||||
|
intentional compatibility pin, or deferring an update that needs a migration.
|
||||||
- After the cheap evaluations pass, build the actual devshell and one representative NixOS system
|
- After the cheap evaluations pass, build the actual devshell and one representative NixOS system
|
||||||
(prefer the local box). `nix flake check --no-build` does not expose dependency build failures;
|
(prefer the local box). `nix flake check --no-build` does not expose dependency build failures;
|
||||||
this is especially important when updating build-tool inputs such as Determinate Nix.
|
this is especially important when updating build-tool inputs such as Determinate Nix.
|
||||||
+91
-24
@@ -7,16 +7,31 @@ the canonical source.
|
|||||||
|
|
||||||
The upgrade is **guided, not automated**: do the mechanical and investigative steps, but stop at
|
The upgrade is **guided, not automated**: do the mechanical and investigative steps, but stop at
|
||||||
the judgment points (marked ⏸) — pushing the fork, resolving rebase conflicts, editing the
|
the judgment points (marked ⏸) — pushing the fork, resolving rebase conflicts, editing the
|
||||||
stable-channel configuration, choosing a new release codename, and deleting version guards. Report
|
stable-channel configuration, choosing a new release codename, deleting version guards, and
|
||||||
findings and let the maintainer decide. Keep a running summary and present it before any push or
|
choosing how to handle a service or package that no longer works on its current channel. Report
|
||||||
commit.
|
findings and let the maintainer decide.
|
||||||
|
|
||||||
Work the phases in order; skip one only if explicitly scoped to a subset.
|
Work the phases in order; skip one only if explicitly scoped to a subset.
|
||||||
|
|
||||||
|
## Progress document
|
||||||
|
|
||||||
|
Maintain `docs/nixpkgs-upgrade-progress.md` in the upgrade workspace. It is a working record, not
|
||||||
|
part of the upgrade's history: keep it in the topmost working-copy change, out of the commits that
|
||||||
|
make up the upgrade series, and delete it at [wrap-up](#wrap-up). At the start, record the baseline
|
||||||
|
revision, target channels, and scope. On resume, read it first and verify its revisions and
|
||||||
|
completed steps against the working copy, lockfile, and remote refs.
|
||||||
|
|
||||||
|
Update the document as each phase finishes and before a push, commit, or handoff. Include the
|
||||||
|
reviewed revision or version ranges, links to changelogs or commits, the practical effect on this
|
||||||
|
repo, and any unreviewed items. Record the decisions made and pending, including alternatives,
|
||||||
|
the rationale for a fix or workaround, and the condition for removing a temporary pin or
|
||||||
|
mitigation. Mark inherited choices separately from maintainer approvals. Record validation results
|
||||||
|
against the candidate revisions and leave a concrete next step for any outstanding work.
|
||||||
|
|
||||||
## Setup facts
|
## Setup facts
|
||||||
|
|
||||||
- **Fork checkout:** `~/documents/projects/nixpkgs` — remotes `origin` (`devplayer0/nixpkgs`) and
|
- **Fork checkout** defaults to `../nixpkgs` relative to this flake's root. Verify `origin` points
|
||||||
`upstream` (`NixOS/nixpkgs`). Confirm the path exists; if not, ask.
|
to the `devplayer0/nixpkgs` fork and `upstream` to `NixOS/nixpkgs`. Ask for the location if needed.
|
||||||
- **Fork branches:** `devplayer0` (tracks `nixos-unstable`) and `devplayer0-stable` (tracks the
|
- **Fork branches:** `devplayer0` (tracks `nixos-unstable`) and `devplayer0-stable` (tracks the
|
||||||
current NixOS stable). Each is a small stack of local patches rebased onto upstream.
|
current NixOS stable). Each is a small stack of local patches rebased onto upstream.
|
||||||
- **Flake pins** in `flake.nix` (`inputs`):
|
- **Flake pins** in `flake.nix` (`inputs`):
|
||||||
@@ -35,8 +50,9 @@ Work the phases in order; skip one only if explicitly scoped to a subset.
|
|||||||
Do this first: everything downstream (the fork's `devplayer0-stable` rebase target, the `flake.nix`
|
Do this first: everything downstream (the fork's `devplayer0-stable` rebase target, the `flake.nix`
|
||||||
stable pins) has to agree on one NixOS stable release, so establish it up front.
|
stable pins) has to agree on one NixOS stable release, so establish it up front.
|
||||||
|
|
||||||
1. Find the latest NixOS stable release branch — check `git branch -r` on `upstream` for the newest
|
1. Check the [NixOS stable release notes](https://nixos.org/manual/nixos/stable/release-notes.html)
|
||||||
`release-YY.NN`, or the NixOS release schedule.
|
and the release schedule. A `release-YY.NN` branch can exist during stabilization before that
|
||||||
|
release becomes the published stable channel.
|
||||||
2. Compare it to `<STABLE>` in the `flake.nix` `nixpkgs-stable` / `home-manager-stable` URLs.
|
2. Compare it to `<STABLE>` in the `flake.nix` `nixpkgs-stable` / `home-manager-stable` URLs.
|
||||||
3. **If they already match** (no new stable): note "stable is current" and carry `<STABLE>` into the
|
3. **If they already match** (no new stable): note "stable is current" and carry `<STABLE>` into the
|
||||||
later phases.
|
later phases.
|
||||||
@@ -54,10 +70,22 @@ stable pins) has to agree on one NixOS stable release, so establish it up front.
|
|||||||
For **both** branches — `devplayer0` onto `upstream/nixos-unstable`, and `devplayer0-stable` onto
|
For **both** branches — `devplayer0` onto `upstream/nixos-unstable`, and `devplayer0-stable` onto
|
||||||
`upstream/release-<STABLE>` (the release established in Phase 1):
|
`upstream/release-<STABLE>` (the release established in Phase 1):
|
||||||
|
|
||||||
1. In `~/documents/projects/nixpkgs`, confirm a clean working tree (`git status`). If dirty, stop
|
1. In the fork checkout, confirm a clean working tree (`git status`). If dirty, stop
|
||||||
and report — don't stash silently.
|
and report — don't stash silently.
|
||||||
2. `git fetch upstream --prune` and `git fetch origin --prune`. If the checkout has been idle a
|
2. Fetch the branches explicitly. Some fork checkouts fetch only `master` from `upstream` by default.
|
||||||
long time this fetch can be large and slow; let it finish.
|
Set `stable` to the release established in Phase 1.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git fetch upstream \
|
||||||
|
+refs/heads/master:refs/remotes/upstream/master \
|
||||||
|
+refs/heads/nixos-unstable:refs/remotes/upstream/nixos-unstable \
|
||||||
|
"+refs/heads/release-${stable}:refs/remotes/upstream/release-${stable}" \
|
||||||
|
"+refs/heads/nixos-${stable}:refs/remotes/upstream/nixos-${stable}"
|
||||||
|
git fetch origin --prune
|
||||||
|
```
|
||||||
|
|
||||||
|
The `release-${stable}` branch is the stable fork's rebase base. The published `nixos-${stable}`
|
||||||
|
branch is the source for the stock stable flake input and can lag behind it.
|
||||||
3. Enumerate the patch stack before rebasing:
|
3. Enumerate the patch stack before rebasing:
|
||||||
`git log --oneline upstream/nixos-unstable..origin/devplayer0` (and the stable equivalent
|
`git log --oneline upstream/nixos-unstable..origin/devplayer0` (and the stable equivalent
|
||||||
against `upstream/release-<STABLE>`). For each commit, check whether it has landed upstream or
|
against `upstream/release-<STABLE>`). For each commit, check whether it has landed upstream or
|
||||||
@@ -68,18 +96,23 @@ For **both** branches — `devplayer0` onto `upstream/nixos-unstable`, and `devp
|
|||||||
- ⏸ **Conflicts:** stop. Report which patch conflicts and against what upstream change; let the
|
- ⏸ **Conflicts:** stop. Report which patch conflicts and against what upstream change; let the
|
||||||
maintainer resolve, or drop the patch if it has been upstreamed.
|
maintainer resolve, or drop the patch if it has been upstreamed.
|
||||||
- Clean rebase: continue.
|
- Clean rebase: continue.
|
||||||
5. Summarize: which patches still apply, which are now redundant (candidate to drop), which
|
5. If the upgrade includes requested upstream fixes, verify them on each new base. Cherry-pick
|
||||||
conflicted.
|
only where the fix is missing and use `git cherry-pick -x` to record the source commit. Check the
|
||||||
6. ⏸ **Push:** only after confirmation. `git push --force-with-lease origin devplayer0
|
resulting package versions or patches on both fork branches and on the published channels.
|
||||||
|
6. Run `git range-diff <old-base>..<old-tip> <new-base>..<new-tip>` for both branches. Use the
|
||||||
|
fork's previous upstream bases for the old ranges. Present the comparison before asking to push,
|
||||||
|
identifying unchanged, modified, dropped, and added patches. For dropped or modified patches,
|
||||||
|
give the reason and cite the superseding upstream commit when applicable.
|
||||||
|
7. ⏸ **Push:** only after confirmation. `git push --force-with-lease origin devplayer0
|
||||||
devplayer0-stable` (force needed — rebase rewrites history).
|
devplayer0-stable` (force needed — rebase rewrites history).
|
||||||
7. Wait for the GitHub mirror used by the flake inputs to catch up with the primary fork remote.
|
8. Wait for the GitHub mirror used by the flake inputs to catch up with the primary fork remote.
|
||||||
Compare the local branch tips with
|
Compare the local branch tips with
|
||||||
`git ls-remote https://github.com/devplayer0/nixpkgs.git refs/heads/devplayer0
|
`git ls-remote https://github.com/devplayer0/nixpkgs.git refs/heads/devplayer0
|
||||||
refs/heads/devplayer0-stable` and do not continue until both match. Updating sooner can leave
|
refs/heads/devplayer0-stable` and do not continue until both match. Updating sooner can leave
|
||||||
`nixpkgs-mine` and `nixpkgs-mine-stable` pinned to the pre-rebase commits even though the push
|
`nixpkgs-mine` and `nixpkgs-mine-stable` pinned to the pre-rebase commits even though the push
|
||||||
succeeded.
|
succeeded.
|
||||||
|
|
||||||
## Phase 3 — Update the pinned inputs
|
## Phase 3 — Update nixpkgs and home-manager pins and review compatibility
|
||||||
|
|
||||||
Run together (they move as a set):
|
Run together (they move as a set):
|
||||||
|
|
||||||
@@ -91,6 +124,17 @@ update-home-manager
|
|||||||
Then show the `flake.lock` diff for the nixpkgs/home-manager entries so the old→new revisions are
|
Then show the `flake.lock` diff for the nixpkgs/home-manager entries so the old→new revisions are
|
||||||
visible.
|
visible.
|
||||||
|
|
||||||
|
Review the NixOS and home-manager modules and packages used by this repo against the previous and
|
||||||
|
candidate pins for their assigned channels. Use release notes and version and option changes to
|
||||||
|
identify removals, end-of-life versions, major upgrades, and changed defaults. Include packages
|
||||||
|
selected by service modules and local overrides. Prioritize stateful services and check upstream
|
||||||
|
migration notes for data formats, supported upgrade paths, extensions, and client compatibility.
|
||||||
|
Record the affected boxes, versions, and any action needed before switching. Surface changes that
|
||||||
|
could break a running app even if its configuration evaluates and builds.
|
||||||
|
|
||||||
|
⏸ Discuss channel moves or migrations with the maintainer before editing the affected service.
|
||||||
|
Use the compatibility decision in Phase 7 for any blockers found here.
|
||||||
|
|
||||||
## Phase 4 — Refresh kernels and release metadata
|
## Phase 4 — Refresh kernels and release metadata
|
||||||
|
|
||||||
Update the repository values that deliberately move with nixpkgs upgrades:
|
Update the repository values that deliberately move with nixpkgs upgrades:
|
||||||
@@ -130,13 +174,17 @@ candidates. ⏸ Don't delete guards without confirmation — some protect the st
|
|||||||
|
|
||||||
Don't blanket-update. Walk the other inputs deliberately:
|
Don't blanket-update. Walk the other inputs deliberately:
|
||||||
|
|
||||||
1. List inputs and locked revisions from `flake.lock` (or `nix flake metadata`).
|
1. List all direct inputs with their locked revisions and configured refs. Include fixed release
|
||||||
2. For each meaningful input (`libnetRepo`, `devshell`, `determinate-nix`, `ragenix`, `deploy-rs`,
|
tags, fork branches, and non-GitHub inputs. Identify which inputs already follow one of the
|
||||||
`impermanence`, and the packaged apps like `boardie`, `harmonia`, and `copyparty`),
|
refreshed nixpkgs pins and which carry independent pins.
|
||||||
compare the locked revision to upstream and summarize notable changes (breaking changes,
|
2. Compare each locked revision with the candidate revision on the configured branch or release
|
||||||
relevant fixes). Many inputs `follows` `nixpkgs-unstable` and already moved in Phase 3.
|
track. Review the intervening changelog, release notes, advisories, and changes to the interfaces
|
||||||
3. Propose a per-input update list with reasons; update the approved ones with targeted
|
this repo uses. Summarize relevant fixes, breaking changes, and required configuration or build
|
||||||
`nix flake update <input>`, not a global update.
|
changes. Report any comparison you could not complete.
|
||||||
|
3. Refresh the moving inputs and applicable release pins in the main upgrade with targeted
|
||||||
|
`nix flake update <input>` commands. Verify the resulting lock revisions against the reviewed
|
||||||
|
candidates, especially if the fetcher used cached refs. ⏸ Ask before switching release tracks,
|
||||||
|
changing an intentional compatibility pin, or deferring an update that needs a migration.
|
||||||
|
|
||||||
## Phase 7 — Validate
|
## Phase 7 — Validate
|
||||||
|
|
||||||
@@ -150,8 +198,16 @@ Don't blanket-update. Walk the other inputs deliberately:
|
|||||||
4. After the evaluations pass, run `build-system <host>` for one representative NixOS box. Prefer
|
4. After the evaluations pass, run `build-system <host>` for one representative NixOS box. Prefer
|
||||||
the local box when it is managed by this flake: its full closure is likely to exercise the most
|
the local box when it is managed by this flake: its full closure is likely to exercise the most
|
||||||
relevant packages, home-manager configuration and upgraded kernel. Build only; do not switch.
|
relevant packages, home-manager configuration and upgraded kernel. Build only; do not switch.
|
||||||
5. Report eval/build results honestly. On failure, surface the error and stop rather than papering
|
5. Fix mechanical compatibility errors that preserve service behavior. ⏸ If a package was removed,
|
||||||
over it.
|
reached end of life, or needs a major upgrade, explain the choices before editing the affected
|
||||||
|
service. Include the current configured version, the deployed version if verified, and the
|
||||||
|
available paths, such as a temporary channel move, a migration during this upgrade, or a
|
||||||
|
separate service change. Describe effects on persisted data, dependent services, cutover, and
|
||||||
|
rollback where relevant. Ask for a decision for each affected service and continue independent
|
||||||
|
validation while waiting. If the maintainer chooses a temporary pin, add a TODO beside it naming
|
||||||
|
the deferred migration and the condition for removing the pin.
|
||||||
|
6. Report eval/build results and any blockers. A build confirms that the configuration compiles.
|
||||||
|
Confirm the migration prerequisites separately before deployment.
|
||||||
|
|
||||||
## Wrap-up
|
## Wrap-up
|
||||||
|
|
||||||
@@ -159,3 +215,14 @@ Present a final summary: fork rebase outcome (patches kept/dropped/conflicted),
|
|||||||
bump is pending or was applied, kernel and release-metadata changes, the lock diff, version-gate
|
bump is pending or was applied, kernel and release-metadata changes, the lock diff, version-gate
|
||||||
cleanup candidates, inputs updated, and validation results. Leave committing to the maintainer
|
cleanup candidates, inputs updated, and validation results. Leave committing to the maintainer
|
||||||
unless asked; if committing, follow the repo's `area/scope: Capitalized summary` convention.
|
unless asked; if committing, follow the repo's `area/scope: Capitalized summary` convention.
|
||||||
|
|
||||||
|
Split the series into the procedure or skill changes, the pin and input refresh, and a separate
|
||||||
|
change for each service migration done during the upgrade. The refresh's description lists the
|
||||||
|
notable upgrades: kernels, stateful services that migrate data, other major version moves and
|
||||||
|
significant flake input releases, with old and new versions. This keeps the version history
|
||||||
|
readable in `jj log` after the progress document is gone.
|
||||||
|
|
||||||
|
Once the upgrade is deployed, move anything still open in the progress document to its durable
|
||||||
|
home: a TODO beside the pin or workaround it concerns, the affected box page, or a commit
|
||||||
|
message for a decision worth keeping. Then delete the progress document. The next upgrade starts
|
||||||
|
from those TODOs and pages rather than from an old progress document.
|
||||||
Reference in new issue
Block a user