Skip to content

Commit

Permalink
Docs/document environment variables (#746)
Browse files Browse the repository at this point in the history
I would like to extend this document, but i'm done for now. Just wanted
to get the fixes in and document the variables some where
  • Loading branch information
ruben-arts authored Jan 31, 2024
1 parent f1030ef commit 7a5ffd2
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/advanced/advanced_tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ configure = { cmd = [
build = { cmd = ["ninja", "-C", ".build"], depends_on = ["configure"] }

# Using environment variables
run = "python main.py $PIXI_PACKAGE_ROOT"
run = "python main.py $PIXI_PROJECT_ROOT"
set = "export VAR=hello && echo $VAR"

# Cross platform file operations
Expand Down
19 changes: 19 additions & 0 deletions docs/environment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
part: pixi
title: Environment
description: The resulting environment of a pixi installation.
---

# Environment variables
The following environment variables are set by pixi, when using the `pixi run`, `pixi shell`, or `pixi shell-hook` command:

- `PIXI_PROJECT_ROOT`: The root directory of the project.
- `PIXI_PROJECT_NAME`: The name of the project.
- `PIXI_PROJECT_MANIFEST`: The path to the manifest file (`pixi.toml`).
- `PIXI_PROJECT_VERSION`: The version of the project.
- `PIXI_PROMPT`: The prompt to use in the shell, also used by `pixi shell` itself.
- `PIXI_ENVIRONMENT_NAME`: The name of the environment, defaults to `default`.
- `PIXI_ENVIRONMENT_PLATFORMS`: The path to the environment.
- `CONDA_PREFIX`: The path to the environment. (Used by multiple tools that already understand conda environments)
- `CONDA_DEFAULT_ENV`: The name of the environment. (Used by multiple tools that already understand conda environments)
- `PATH`: We prepend the `bin` directory of the environment to the `PATH` variable, so you can use the tools installed in the environment directly.
5 changes: 5 additions & 0 deletions docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
font-weight: normal;
}

.md-typeset *:not(pre) > code {
/* Dimmed 30% of the main yellow color (ffec3d)*/
color: #b3a52b;
}

.md-typeset h1 {
color: #ffec3d;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/ros2-nav2/pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ channels = ["conda-forge", "robostack-staging"]
platforms = ["linux-64", "osx-arm64", "osx-64"]

[tasks]
start = {cmd="export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:$PIXI_PACKAGE_ROOT/.pixi/env/share/turtlebot3_gazebo/models && export TURTLEBOT3_MODEL=waffle && ros2 launch nav2_bringup tb3_simulation_launch.py headless:=False"}
start = {cmd="export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:$PIXI_PROJECT_ROOT/.pixi/env/share/turtlebot3_gazebo/models && export TURTLEBOT3_MODEL=waffle && ros2 launch nav2_bringup tb3_simulation_launch.py headless:=False"}

[dependencies]
ros-humble-desktop = "*"
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ nav:
- Basic Usage: basic_usage.md
- Reference (CLI): cli.md
- Configuration: configuration.md
- Environment: environment.md
- Vision: vision.md
- In-depth:
- Authentication: advanced/authentication.md
Expand Down

0 comments on commit 7a5ffd2

Please sign in to comment.