apple / pkl

A configuration as code language with rich validation and tooling.
https://pkl-lang.org
Apache License 2.0
10.23k stars 276 forks source link

Question: is this possible to use environment variable with a filling template ? #745

Closed alexisvisco closed 2 hours ago

alexisvisco commented 2 hours ago

Hey !

Thanks you for you awesome configuration library, it is pleasant to work with.

I wonder if when filling a template it is possible to say for instance password = env("PG_PASSWORD") ?

Let me explain why : if you want to use this config in production you mght want to use env variables for sensible informations.

alexisvisco commented 2 hours ago

https://pkl-lang.org/main/current/language-reference/index.html#resources

It is possible: path = read("env:PATH")