0e5a095f8dcc

nina setup creates ~/.nina.conf via wizard when config not found

time
2026-06-08 17:51 UTC · 4 months ago
machine
koh2
agent
claude-sonnet-4-6
session
auto-run setup on first run
parent
e66b7c22892f
3 files VERSION+1 −1build.zig.zon+1 −1src/commands.zig+14 −0
VERSION+1 −1
@@ -1 +1 @@1-3.0.211+3.0.22

view file

build.zig.zon+1 −1
@@ -9,7 +9,7 @@99     .name = .nina,1010     // This is a [Semantic Version](https://semver.org/).1111     // In a future version of Zig it will be used for package deduplication.12-    .version = "3.0.21",12+    .version = "3.0.22",1313     // Together with name, this represents a globally unique package1414     // identifier. This field is generated by the Zig toolchain when the1515     // package is first created, and then *never changes*. This allows

view file

src/commands.zig+14 −0
@@ -1142,6 +1142,20 @@11421142 }11431143 11441144 pub fn setup(gpa: std.mem.Allocator, io: std.Io, environ: *const std.process.Environ.Map) !void {1145+    // Create ~/.nina.conf first if it doesn't exist. This makes `nina setup`1146+    // a complete onboarding command — not just a nix-features check.1147+    if (environ.get("HOME")) |home| {1148+        var path_buf: [512]u8 = undefined;1149+        if (std.fmt.bufPrint(&path_buf, "{s}/.nina.conf", .{home})) |conf_path| {1150+            if (std.Io.Dir.openFile(.cwd(), io, conf_path, .{})) |f| {1151+                f.close(io);1152+            } else |_| {1153+                try firstRunWizard(gpa, io, environ);1154+                errors.error_info.reset();1155+            }1156+        } else |_| {}1157+    }1158+11451159     output.setupCheck();11461160     const status = exec.checkNixFeatures(gpa, io, environ);11471161     output.setupFeatures(status.nix_command, status.flakes);

view file