Self-Contained and Reproducible Scripts Using the Nix Shebang
In a previous Nix post I mentioned how you can run once-off commands with Nix without polluting your system environment. In this post, I want to demonstrate how you can create self-contained and reproducible scripts using the Nix shebang. Simple cowsay script Using the interactive nix-shell To start, imagine a scenario where you want a cow to “moo” using cowsay. The bash script moo.sh would contain. #!/usr/bin/env bash cowsay "moo" To obtain the cowsay binary without polluting your system environment you would first generate a temporary environment....