c89bd7b1bf37

add --no-write-lock-file to nix profile install (tarball flakes are read-only, cannot persist lock); fix unstable channel URL to channels.nixos.org (old releases.nixos.org path 404s); try prebuilt static binary on NixOS before source build

time
2026-06-05 16:17 UTC · 4 months ago
machine
koh2
agent
claude-opus-4-8
session
fix install.sh nixos failure
parent
402c59e6e7e7
1 file install.sh+17 −2
install.sh+17 −2
@@ -137,7 +137,10 @@137137   have nix || return 1138138   say "installing nina to ~/.nix-profile/bin/nina via nix profile..."139139   blank140-  if nix profile install "${FLAKE_URL}#nina"; then140+  # Tarball flakes are fetched read-only into the store, so nix cannot persist141+  # a freshly-resolved flake.lock and aborts with "cannot write modified lock142+  # file". --no-write-lock-file resolves inputs in memory without writing.143+  if nix profile install --no-write-lock-file "${FLAKE_URL}#nina"; then141144     return 0142145   fi143146   blank@@ -164,8 +167,10 @@164167     :165168   else166169     say "zig_0_16 not in channel — fetching from nixpkgs-unstable..."170+    # channels.nixos.org redirects to the current unstable release tarball;171+    # the older releases.nixos.org/.../nixos-unstable/ path 404s.167172     nix-shell \168-      -I nixpkgs=https://releases.nixos.org/nixos/unstable/nixos-unstable/nixexprs.tar.xz \173+      -I nixpkgs=https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz \169174       -p zig_0_16 \170175       --run "$build_cmd" \171176       || die "build failed — see output above"@@ -342,6 +347,16 @@342347     farewell343348     exit 0344349   fi350+  # nina's binaries link no libc, so the Linux builds are fully static and run351+  # on NixOS — try the prebuilt before falling back to a from-source build.352+  say "trying prebuilt binary from Kepr..."353+  if install_binary; then354+    check_path355+    maybe_setup_features356+    farewell357+    exit 0358+  fi359+  say "no prebuilt binary available — building from source"345360   nixos_shell_build346361   generate_nixos_module347362   check_path

view file