Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow environment variables definition on activation without setting them in pixi.toml #1726

Closed
yonil7 opened this issue Aug 2, 2024 · 1 comment · Fixed by #1740
Closed
Labels
✨ enhancement Feature request

Comments

@yonil7
Copy link

yonil7 commented Aug 2, 2024

Problem description

  1. [activation.env] section does not support some kind of composite env var syntax that will allow defining env variables such as: PGDATA="${PIXI_PROJECT_ROOT}/my_pg_data_folder"
  2. [activation.script] section only allows running scripts files. (so I cant do: export PGDATA="${PIXI_PROJECT_ROOT}/my_pg_data_folder or source my_env_vars_definition_script.sh there)
    This means there is no way to define "composite" env vars on pixi activation. (not in pixi.toml syntax and not by running something else on activation)
@yonil7 yonil7 added the ✨ enhancement Feature request label Aug 2, 2024
@ruben-arts
Copy link
Contributor

That would indeed be nicer. Currently the activation env is thrown on the pile of env vars that pixi adds to the activation.

What does work in this case is:
pixi.toml:

[activation]
scripts = ["activation.sh"]

activation.sh:

export PGDATA="$PIXI_PROJECT_ROOT/my_pg_data_folder"
# Make sure you escape the `$` on your shell
pixi run "echo \$PGDATA"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement Feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants