tvix: don't panic on unfamiliar NIX_PATHs

#370
Opened by someoneserge at 2024-01-17T21·58+00

Observed:

❯ echo $NIX_PATH
nixpkgs=flake:nixpkgs:...
❯ ./result/bin/tvix 
tvix-repl> <nixpkgs>
thread 'main' panicked at src/value/mod.rs:989:36:
total_fmt() called on a CatchableErrorKind
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
❯ NIX_PATH=nixpkgs=/nix/store/vqljs1ixabpdbfmq3llnlkj5dac1hq4c-source ./result/bin/tvix 
tvix-repl> <nixpkgs>
=> /nix/store/vqljs1ixabpdbfmq3llnlkj5dac1hq4c-source :: path
tvix-repl>

Also command history lost from the previous session (no ctrl-r, no arrow-up).

Expected: an error message about not being able to interpret the NIX_PATH, and specifically about not supporting flakes. History accessible in the next session.

EDIT: αυτο! https://github.com/gytis-ivaskevicius/high-quality-nix-content/raw/master/memes/nix-path-supports-urls.jpg

  1. someoneserge updated the body of this issue at 2024-01-18T15·10+00