Nix-script - write scripts in compiled languages that run in the nix ecosystem, with no separate build step

https://bytes.zone/posts/nix-script/

8 Likes

See also GitHub - xzfc/cached-nix-shell: Instant startup time for nix-shell.

And Nix flakes also allow faster shells thanks to evaluation cache. Edit: Not sure if it can be used in shebang, cannot find a reference now.

But yours adds extra convenience of handling Haskell dependencies more simply.

3 Likes

Nice! Reminds me of https://github.com/igor-petruk/scriptisto

2 Likes

Most of the time I start in bash, thinking the task won’t be too complicated… but then before I know it I’m having to reread the bash man pages to figure out how arrays work for the thousandth time.

This is too real :smile:

7 Likes

There’s an earlier project with the same purpose and name by @bennofs here, although it hasn’t seen any updates this year, and I don’t believe it compiles the script itself: GitHub - bennofs/nix-script: A shebang for running scripts inside nix-shell with defined dependencies

2 Likes