# `Precompiled.Config`
[🔗](https://github.com/TomHoenderdos/elixir_precompiled/blob/v0.2.1/lib/precompiled/config.ex#L5)

The client's configuration: `config :precompiled, source: url` plus
`except: [dep, ...]` and `root: path`; `Precompiled.Host.install/2` passes
the same keys as options.

Environment variables: `PRECOMPILED=0` disables a run;
`PRECOMPILED_SOURCE` sets the source when no `source:` option is
passed, over the app config (same https-only rule);
`PRECOMPILED_HOME` moves the cache; `PRECOMPILED_OFFLINE=1`
is offline mode (below); `PRECOMPILED_CACERTS_PATH` (else
`HEX_CACERTS_PATH`) names a CA bundle that replaces the OS store;
`PRECOMPILED_DEBUG=1` prints why each dependency was not a
candidate.

Also: `deadline_seconds:` (default 300) bounds a whole run, after which
every dependency still waiting compiles from source; `root_check_seconds:`
(default 3600) is how often the served root is fetched; `content: [url]`
names CDN or mirror origins the files may come from (https only);
`cache_max_mb:` (default 4096) bounds the download cache, least recently
used entries going first (checked at most once a day).
`PRECOMPILED_OFFLINE=1` makes no request: the last verified batch
and the cache only, and only while that batch is still fresh.

# `t`

```elixir
@type t() :: %{
  source: String.t(),
  except: [atom()],
  root_path: Path.t(),
  home: Path.t() | nil,
  clock_offset_seconds: integer(),
  offline: boolean(),
  deadline_ms: non_neg_integer(),
  metadata_timeout_ms: pos_integer(),
  connect_timeout_ms: pos_integer(),
  root_check_seconds: non_neg_integer(),
  cache_max_bytes: non_neg_integer(),
  content_override: [String.t()] | nil
}
```

# `debug?`

```elixir
@spec debug?() :: boolean()
```

True when `PRECOMPILED_DEBUG` (or the old `NERVES_PRECOMPILED_DEBUG`) is `1`.

# `disabled?`

```elixir
@spec disabled?() :: boolean()
```

True when `PRECOMPILED=0`, `PRECOMPILED=false` or `PRECOMPILED=no` (the old `NERVES_PRECOMPILED` works the same).

# `home_dir`

```elixir
@spec home_dir(keyword()) :: Path.t() | nil
```

The cache home a run would use: `:home`, `PRECOMPILED_HOME`, else the user cache dir; nil when the OS has none.

# `load`

```elixir
@spec load(keyword()) :: t() | nil
```

# `offline?`

```elixir
@spec offline?() :: boolean()
```

True when `PRECOMPILED_OFFLINE` is `1`, `true` or `yes`: no network, the cached batch and cache only.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
