nix-book/source/recipes/shebang/main.adoc
Amy de Buitléir 96f65dd5a5 expanded
2025-10-12 15:59:19 +01:00

18 lines
643 B
Text

[#shebang]
= Scripts
You can use `nix shell` to run scripts in arbitrary languages, providing
the necessary dependencies.
This is particularly convenient for standalone scripts
because you don't need to create a repo and write a separate `flake.nix`.
The script should start with two _"shebang"_ (`#!`) commands.
The first should invoke `nix`.
The second should declares the script interpreter and any dependencies.
include::nixpkg/main-generated.adoc[leveloffset=+1]
include::flake/main-generated.adoc[leveloffset=+1]
include::haskell-nixpkg/main-generated.adoc[leveloffset=+1]
include::python-nixpkg/main-generated.adoc[leveloffset=+1]