 use Mix.Config
+
+# Repository specific configuration
 
 system = :nerves_system_rpi0
 platform = "rpi0"
 arch = "arm"
 
+app_part_devparth = "/dev/mmcblk0p3"
+network_interface = System.get_env("NERVES_NETWORK_INTERFACE") || "wlan0"
+
+# Environment specific configuration
+#  Nerves Project test farm configuration
+#  NERVES_TEST_SERVER = nerves-test-server.herokuapp.com
+#  WEBSOCKET_PROTOCOL = wss
+
 test_server = System.get_env("NERVES_TEST_SERVER")
-network_interface = System.get_env("NERVES_NETWORK_INTERFACE") || "usb0"
 websocket_protocol = System.get_env("WEBSOCKET_PROTOCOL") || "ws"
 
+# Common configuration
+
+# Configure bootloader boot order.
 config :bootloader,
   app: :nerves_system_test,
   init: [:nerves_runtime, :nerves_network]
 
+# Only trust signed firmware
 config :nerves_system_test, :firmware,
   public_key: System.get_env("NERVES_FW_PUB_KEY")
 
+# Configure system_registry term storage to store the wifi credentials on the
+#  app data partition. If the device is using eth0 as the primary connection
+#  mechanism the wlan0 settings do not need to be configured.
 config :system_registry, SystemRegistry.TermStorage,
   path: "/root/system_registry",
   scopes: [

    {:nerves_system_test, :priv_dir, "test"}
  ]

config :nerves_runtime, :kv,
  nerves_fw_application_part0_devpath: "/dev/mmcblk0p3",
  nerves_fw_application_part0_fstype: "ext4",
  nerves_fw_application_part0_target: "/root",
  nerves_fw_architecture: arch,

    ipv4_address_method: :linklocal
  ]

# Configure the url for the connection to the test server phoenix channel socket.
config :nerves_system_test, NervesTestServer.Socket,
  url: "#{websocket_protocol}://#{test_server}/socket/websocket"

# Configure the test suite. nerves_system_test needs to know information such as
#  system - the name of the system repo the tests are being executed on
#  network_interface - the interface that should be used for reporting the
#   results on
#  tests - the locations for the tests to run.
#    Currently, it is only supported that tests are included in the priv_dir
#    of the app and dependencies. The default layout runs tests that are common
#    across devices (:nerves_system_test) and those that are specific to the
#    device (this app)
config :nerves_system_test,
  system: system,
  network_interface: network_interface,
