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

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

7 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.

2 Likes

Nice! Reminds me of GitHub - igor-petruk/scriptisto: A language-agnostic "shebang interpreter" that enables you to write scripts in compiled languages.

1 Like

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:

5 Likes