mirror of
https://codeberg.org/mhwombat/nix-book.git
synced 2026-01-27 17:07:13 +08:00
18 lines
643 B
Text
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]
|