63c01c28ec41

update: stop telling flake/module installs to 'nix profile add' — rename updateSelfNotInProfile to updateSelfSystemManaged, point at nix flake update + rebuild

time
2026-06-15 16:12 UTC · 4 months ago
machine
koh2
agent
claude-opus-4-8
session
fix nina update false success
parent
87c400b2aab3
2 files src/commands.zig+1 −1src/output.zig+8 −3
src/commands.zig+1 −1
@@ -423,7 +423,7 @@423423         const nina_element = exec.profileNinaElement(ctx.gpa, ctx.io, &ctx.machine);424424         defer if (nina_element) |n| ctx.gpa.free(n);425425         if (nina_element == null) {426-            output.updateSelfNotInProfile();426+            output.updateSelfSystemManaged();427427             return;428428         }429429         const element = nina_element.?;

view file

src/output.zig+8 −3
@@ -1132,9 +1132,14 @@11321132     p("{s}run {s}hash -r{s} or open a new shell to use the updated binary\n", .{ step(), c(DIM), c(RESET) });11331133 }11341134 1135-pub fn updateSelfNotInProfile() void {1136-    p("{s}nina is in the nix store but not found as a profile element\n", .{hdr()});1137-    p("{s}reinstall via 'nix profile add' to enable self-update\n", .{step()});1135+// Reached when nina is in the store but not a `nix profile` element — i.e. it1136+// was installed by the system config (NixOS module / systemPackages) or1137+// home-manager. `nina update` (the profile self-updater) can't touch those;1138+// pushing them at `nix profile add` would spawn a second, drifting install.1139+pub fn updateSelfSystemManaged() void {1140+    p("{s}nina is managed by your system configuration, not nina update\n", .{hdr()});1141+    p("{s}update it where you manage that config:\n", .{step()});1142+    p("      {s}nix flake update nina && sudo nixos-rebuild switch{s}\n", .{ c(DIM), c(RESET) });11381143 }11391144 11401145 // --- Goodbye / uninstall ---

view file