nix-book/source/recipes/shebang/main.adoc
Amy de Buitléir 2a910c9bcf temp
2025-09-06 18:26:28 +01:00

17 lines
632 B
Text

= 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]