Skip to content

Commit 324cf15

Browse files
committed
Add docs about env vars
Closes #10
1 parent 52812ff commit 324cf15

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

lib/rustler_precompiled.ex

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,38 @@ defmodule RustlerPrecompiled do
6565
In case "force build" is used, all options except `:base_url`, `:version`,
6666
`:force_build`, `:nif_versions`, and `:targets` are going to be passed down to `Rustler`.
6767
So if you need to configure the build, check the `Rustler` options.
68+
69+
## Environment variables
70+
71+
This project reads some system environment variables. They are all optional, but they
72+
can change the behaviour of this library at **compile time** of your project.
73+
74+
They are:
75+
76+
* `HTTP_PROXY` or `http_proxy` - Sets the HTTP proxy configuration.
77+
78+
* `HTTPS_PROXY` or `https_proxy` - Sets the HTTPS proxy configuration.
79+
80+
* `MIX_XDG` - If present, sets the OS as `:linux` for the `:filename.basedir/3` when getting
81+
an user cache dir.
82+
83+
* `TARGET_ARCH` - The CPU target architecture. This is useful for when building your Nerves
84+
project, where your host CPU is different from your target CPU.
85+
86+
Note that Nerves sets this value automatically when building your project.
87+
88+
Examples: `arm`, `aarch64`, `x86_64`, `riscv64`.
89+
90+
* `TARGET_ABI` - The target ABI (e.g., `gnueabihf`, `musl`). This is set by Nerves as well.
91+
92+
* `TARGET_VENDOR` - The target vendor (e.g., `unknown`, `apple`, `pc`). This is **not** set by Nerves.
93+
If any of the `TARGET_` env vars is set, but `TARGET_VENDOR` is empty, then we change the
94+
target vendor to `unknown` that is the default value for Linux systems.
95+
96+
* `TARGET_OS` - The target operational system. This is always `linux` for Nerves.
97+
98+
For more details about Nerves env vars, see https://hexdocs.pm/nerves/environment-variables.html
99+
68100
"""
69101
defmacro __using__(opts) do
70102
force =

0 commit comments

Comments
 (0)