Skip to content

Commit

Permalink
Merge pull request #663 from NixOS/chained-script-interpreter
Browse files Browse the repository at this point in the history
Explain chained script interpreter
  • Loading branch information
zmitchell authored Jul 27, 2023
2 parents 2781cb4 + 808ac3b commit 0d6c103
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/tutorials/first-steps/reproducible-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ Create a file named `nixpkgs-releases.sh` with the following content:
curl https://github.com/NixOS/nixpkgs/releases.atom | xml2json | jq .
```

We specify the `bash` program as the interpreter with the `-i` option.
The first line is a standard shebang.
The additional shebang lines are a Nix-specific construct.

We specify `bash` as the interpreter for the rest of the file with the `-i` option.

We enable the `--pure` option to prevent the script from implicitly using programs that may already exist on the system that will run the script.

With the `-p` option we specify the packages required for the script to run.
Expand Down

0 comments on commit 0d6c103

Please sign in to comment.