initial commit

This commit is contained in:
Amy de Buitléir 2025-09-04 20:40:37 +01:00
parent 5e2da971de
commit 9997760554

View file

@ -0,0 +1,39 @@
= Scripts with access to...
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.
== A top level package from the Nixpkgs/NixOS repo
[source,bash,linenums,highlight=1..2]
.Script
....
$# cat run-nixpkg.sh
....
.Output
....
$# ./run-nixpkg.sh
....
== A flake
In this example, we will use a flake defined in a remote git repo.
However, you can use any of the flake reference styles defined in <<#flakeref>>.
[source,bash,linenums,highlight=1..2]
.Script
....
$# cat run-flake.sh
....
.Output
....
$# ./run-flake.sh
....