jeff-hykin / nix_version_search_cli

Nix Version Search CLI - user friendly way to find any version
MIT License
28 stars 3 forks source link

Flake build fix #7

Closed pierzchalski closed 2 months ago

pierzchalski commented 2 months ago

Fixes #6.

Switching from deno compile to deno install seems unfortunate, but it looks like working around the flake build sandbox would be pretty painful. Alternatively we could replace builtins.import ./default.nix with another derivation definition within flake.nix?

pierzchalski commented 2 months ago

Ugh, never mind:

❯ nvs krb5
/home/eap/.nix-profile/bin/nvs: 3: exec: deno: not found

It seems deno compile is a must-have... maybe deno2nix will work?

jeff-hykin commented 2 months ago

it looks like working around the flake build sandbox would be pretty painful

it was. This was a +8hr nightmare of a fix with a ton of build complexity added. Right now I'm generating a fake home folder, then using nix-shell with deno, compiling a dummy program, and that generates cache files in the fake-home. Then I sync those 25Mb zipped cache files (6 total, one for each OS) on github because, as I very painfully found-out, it seems the sandboxed build only works with git-committed files. Its weird to me that it relies on git at all but I can't explain the behaivor any other way.

But, its done. It should now work on linux flakes completely within the sandbox.

I think the other solutions are definitely worth looking into in the future. And I appreciate you making a PR and working on the problem. Deno install probably would work if deno was marked as a runtime dependency.

pierzchalski commented 2 months ago

I can confirm that v1.4.29 successfully installs and runs as a flake. Thanks @jeff-hykin! I'm sorry it was so much work for you.

It also looks like the compiled nvs binary is much faster than the installed one, unsurprisingly, so that might not actually be a great future direction.

Thanks again!