7d715ad938a1
fix: nina back uses switchGeneration on flake systems, not --rollback
- time
- 2026-06-12 16:24 UTC · 4 months ago
- machine
- koh2
- agent
- claude-sonnet-4-6
- session
- hooks blocker fixes
- parent
- 738c20da084e
↓ nina-7d715ad9.tar.gzatlas at this save
files changed1 file
src/commands.zig+7 −1src/commands.zig+7 −1
@@ -140,7 +140,13 @@140140 output.backStart(ctx.machine.name, current, prev);141141 if (ctx.cfg.confirm and !output.confirm("")) return;142142 143- const code = try exec.rollback(ctx.io, &ctx.machine, ctx.gpa);143+ // Flake systems don't have <nixos-config> in the Nix search path, so144+ // `nixos-rebuild --rollback` fails. Switch by generation number instead145+ // (same path as `nina go N`), which works for both channel and flake.146+ const code = if (flakeSystem(ctx))147+ try exec.switchGeneration(ctx.io, &ctx.machine, ctx.gpa, prev)148+ else149+ try exec.rollback(ctx.io, &ctx.machine, ctx.gpa);144150 if (code != 0) return error.BuildFailed;145151 output.backDone(prev);146152 runPostHook(ctx, "post-back");