be5e5b56ec22

home history: parse home-manager generations into aligned table — homeHistory captures 'home-manager generations', parses into number/date/time rows via parseHomeGenerations, renders through output.homeHistoryRow with the first (newest) row marked current; build+tests green incl parseHomeGenerations unit test

time
2026-06-10 01:26 UTC · 4 months ago
machine
koh2
agent
claude-opus-4-8
session
flake + home manager support
parent
89cc9bd8035f
1 file src/commands.zig+11 −0
src/commands.zig+11 −0
@@ -945,8 +945,19 @@945945     }946946 947947     if (std.mem.eql(u8, ctx.sub, "back")) return homeBack(ctx);948+    if (std.mem.eql(u8, ctx.sub, "history")) return homeHistory(ctx);948949 949950     return output.subcommandHelp("home", &home_help, null);951+}952+953+fn homeHistory(ctx: Ctx) !void {954+    const out = try exec.homeGenerations(ctx.gpa, ctx.io, &ctx.machine);955+    defer ctx.gpa.free(out);956+    const gens = try parseHomeGenerations(ctx.gpa, out);957+    defer freeHomeGens(ctx.gpa, gens);958+    output.homeHistoryHeader(ctx.machine.name);959+    // Newest-first from home-manager; the first row is the current generation.960+    for (gens, 0..) |g, i| output.homeHistoryRow(g.number, g.date, g.time, i == 0);950961 }951962 952963 fn homeBack(ctx: Ctx) !void {

view file