Nerves v0.4.6 Nerves.Env

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.

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

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

Returns the archetecture for the host system

Returns the platform for the host system

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

Functions

bootstrap()
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.

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

Ensures that an application which contins 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
host_arch()
host_arch() :: String.t

Returns the archetecture for the host system.

Example return values

“x86_64” “arm”

host_platform()
host_platform() :: String.t

Returns the platform for the host system.

Example return values

“win” “linux” “darwin”

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

Gets a package by app name.

packages()
packages() :: [Nerves.Package.t]

Lists all Nerves packages loaded in the Nerves environment.

packages_by_type(type, packages \\ nil)

Lists packages by package type.

start()
start() :: Agent.on_start

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()
stop() :: :ok

Stop the Nerves environment agent.

system()
system() :: Nerves.Package.t

Helper function for returning the system type package

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

Helper function for returning the system_platform type package

toolchain()
toolchain() :: Nerves.Package.t

Helper function for returning the toolchain type package

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

Helper function for returning the toolchain_platform type package