From 9814f6462e7f1703c1a6464cad9db5b624d918d5 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Mon, 21 Sep 2015 05:32:01 +0200 Subject: [PATCH] Update readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 2c1b3eb..93fe3b1 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ To use `nix-script`, you need to add a header to your file. Here is an example f ```haskell #!/usr/bin/env nix-script #!> haskell +#! env | EDITOR #! haskell | text lens optparse-applicative #! shell | nix nix-prefetch-scripts @@ -40,6 +41,8 @@ The first line just tells the shell to use `nix-script` when executing the scrip The next lines the specify dependencies of the script. The first entry on each line is the language of the following dependencies. This is required so that language-specific names can be converted to the correct nix attribute names. You should have one line per language. In our case, we say that we want to use the `text`, `lens` and `optparse-applicative` haskell packages. We also want that `nix` and `nix-prefetch-scripts` are available in $PATH (the `shell` language doesn't apply any renaming to their dependencies and just passes them through unmodified). +The lines starting with `env` specify additional environment variables to be kept in the environment where the script will run. In this case the variable`EDITOR` editor. + We can now mark the script executable and run it: ```