Nerves v1.5.1 Nerves.Env View Source

Contains package info for Nerves dependencies

The Nerves Env is used to load information from dependencies that contain a nerves.exs config file in the root of the dependency path. Nerves loads this config because it needs access to information about Nerves compile time dependencies before any code is compiled.

Link to this section Summary

Functions

Export environment variables used by Elixir, Erlang, C/C++ and other tools so that they use Nerves toolchain parameters and not the host's.

Re evaluates the mix file under a different target.

Cleans the artifacts for the package build_runners of all specified packages.

Disable the Nerves Env compilers

The download location for artifacts.

Enable the Nerves Env compilers

Check if the env compilers are disabled

Ensures that an application which contains a Nerves package config has been loaded into the environment agent.

Returns the architecture for the host system.

Returns the os for the host system.

Check if the Nerves.Env is loaded

Gets a package by app name.

Lists all Nerves packages loaded in the Nerves environment.

Lists packages by package type.

Starts the Nerves environment agent and loads package information. If the Nerves.Env is already started, the function returns {:error, {:already_started, pid}} with the pid of that process

Stop the Nerves environment agent.

Helper function for returning the system type package

Helper function for returning the system_platform type package

Helper function for returning the toolchain type package

Helper function for returning the toolchain_platform type package

Link to this section Functions

Link to this function

bootstrap()

View Source
bootstrap() :: :ok

Export environment variables used by Elixir, Erlang, C/C++ and other tools so that they use Nerves toolchain parameters and not the host's.

For a comprehensive list of environment variables, see the documentation for the package defining system_platform.

Link to this function

change_target(target)

View Source
change_target(String.t()) :: :no_return

Re evaluates the mix file under a different target.

This allows you to start in one target, like host, but then switch to a different target.

Link to this function

clean(pkgs)

View Source
clean([Nerves.Package.t()]) :: :ok | {:error, term()}

Cleans the artifacts for the package build_runners of all specified packages.

Link to this function

disable()

View Source
disable() :: :ok

Disable the Nerves Env compilers

Link to this function

download_dir()

View Source
download_dir() :: path :: String.t()

The download location for artifacts.

Placing an artifact tar in this location will bypass the need for it to be downloaded.

Link to this function

enable()

View Source
enable() :: :ok

Enable the Nerves Env compilers

Check if the env compilers are disabled

Link to this function

ensure_loaded(app, path \\ nil)

View Source
ensure_loaded(app :: atom(), path :: String.t()) ::
  {:ok, Nerves.Package.t()} | {:error, term()}

Ensures that an application which contains a Nerves package config has been loaded into the environment agent.

Options

  • app - The atom of the app to load
  • path - Optional path for the app

Returns the architecture for the host system.

Example return values

"x86_64" "arm"

Returns the os for the host system.

Example return values

"win" "linux" "darwin"

Check if the Nerves.Env is loaded

Link to this function

package(name)

View Source
package(name :: atom()) :: Nerves.Package.t() | nil

Gets a package by app name.

Lists all Nerves packages loaded in the Nerves environment.

Link to this function

packages_by_type(type, packages \\ nil)

View Source

Lists packages by package type.

Starts the Nerves environment agent and loads package information. If the Nerves.Env is already started, the function returns {:error, {:already_started, pid}} with the pid of that process

Stop the Nerves environment agent.

Helper function for returning the system type package

Link to this function

system_platform()

View Source
system_platform() :: Nerves.Package.t()

Helper function for returning the system_platform type package

Helper function for returning the toolchain type package

Link to this function

toolchain_platform()

View Source
toolchain_platform() :: Nerves.Package.t()

Helper function for returning the toolchain_platform type package