-
Notifications
You must be signed in to change notification settings - Fork 0
Add static and computed environment variables #2
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,9 @@ The flake schemas are also helpful: | |
|
|
||
| ```text | ||
| { | ||
| inherit (inputs.up) schemas; | ||
| schemas = inputs.up.exportedSchemas // { | ||
| # other schemas | ||
| }; | ||
| } | ||
| ``` | ||
|
|
||
|
|
@@ -154,3 +156,32 @@ To run it: | |
| ```shell | ||
| nix run ".#taskRunners.<system>.default" | ||
| ``` | ||
|
|
||
| ## Environment variable sets | ||
|
|
||
| There are two types of environment variable sets: **static** and **computed**. | ||
| Static sets are attribute sets of strings: | ||
|
|
||
| ```nix | ||
| { | ||
| staticEnvVars.postgres = { | ||
| PGDATA = ".state/postgres"; | ||
| PGDATABASE = "testing"; | ||
| PGHOST = "127.0.0.1"; | ||
| PGPORT = toString 5432; | ||
| }; | ||
| } | ||
| ``` | ||
|
|
||
| Computed sets are system specific and may be based on things like packages in Nixpkgs: | ||
|
|
||
| ```nix | ||
| computedEnvVars = forEachSupportedSystem ( | ||
| { pkgs, system }: | ||
| { | ||
| postgres = { | ||
| PGSSLCERT = "${pkgs.postgresql}/share/postgresql/root.crt"; | ||
| }; | ||
| } | ||
| ); | ||
|
Comment on lines
+176
to
+186
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep the computed example aligned with the actual flake output.
📝 Proposed doc fix computedEnvVars = forEachSupportedSystem (
{ pkgs, system }:
{
- postgres = {
- PGSSLCERT = "${pkgs.postgresql}/share/postgresql/root.crt";
+ openssl = {
+ OPENSSL_DIR = "${pkgs.openssl.dev}";
+ OPENSSL_LIB_DIR = "${pkgs.openssl.out}/lib";
+ OPENSSL_INCLUDE_DIR = "${pkgs.openssl.dev}/include";
};
}
);🧰 Tools🪛 LanguageTool[grammar] ~174-~174: Use a hyphen to join words. (QB_NEW_EN_HYPHEN) 🤖 Prompt for AI Agents |
||
| ``` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hyphenate compound adjective in prose.
Use “system-specific” on Line 176 for correct style.
🧰 Tools
🪛 LanguageTool
[grammar] ~176-~176: Use a hyphen to join words.
Context: ...32; }; } ``` Computed sets are system specific and may be based on things like...
(QB_NEW_EN_HYPHEN)
🤖 Prompt for AI Agents