Skip to content

Commit 7d33201

Browse files
committed
update docs
1 parent ccbc238 commit 7d33201

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docs/recipes.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,12 +405,24 @@ The `set` field is a list of environment variables key-value pairs that specify
405405
* It is not possible to set an initial value that is not `null` for a prefix path variable.
406406
Set such variables to `null` (unset it), then provide `append_path` and `prefix_path` operations below to set the individual paths.
407407

408-
!!! note "using `${@VAR@}` to use environment variables"
408+
!!! info "use `${@VAR@}` to set environment variables at runtime"
409409
Sometimes you want to compose an environment variable **that has been set in the runtime environment** in your environment variable definition.
410410
For example, every user has a different `HOME` or `SCRATCH` value, and you might want to configure your view to store / read configuration from this path.
411411
The special syntax `${@VAR@}` will defer expanding the environment variable `VAR` until the view is loaded by uenv.
412412
The example above shows how to set the Juliaup install directory to be in the user's local scratch, i.e. a personalised private location for each user.
413413

414+
!!! info "use `$@var@` to configure environment variables at configure time"
415+
The special syntax `$@var@` can be used to substitute information about the view when configuring the recipe.
416+
This is useful if you want to set an environment variable that refers to the mount point or mounted location of the view.
417+
418+
The following values are available:
419+
420+
| key | description |
421+
| --- | ----------- |
422+
| `mount` | the mount point of the image, e.g. `/user-environment` |
423+
| `view_name` | the name of the view, e.g. `cuda-env` in the example above |
424+
| `view_path` | the prefix path of the view, e.g. `/user-environment/env/cuda-env` |
425+
414426
The `prepend_path` field takes a list of key-value pairs that define paths to prepend to a prefix path variable.
415427

416428
* Each entry is a single path

0 commit comments

Comments
 (0)