2021-02-22 01:32:35 +03:00
|
|
|
{ device ? null, configuration ? null, pkgs ? null }@args:
|
2019-09-21 22:40:46 +03:00
|
|
|
|
2021-02-22 01:32:35 +03:00
|
|
|
let
|
2019-09-25 03:29:44 +03:00
|
|
|
# Selection of the configuration can by made either through NIX_PATH,
|
2020-03-14 01:13:24 +03:00
|
|
|
# through local.nix or as a parameter.
|
2021-02-22 01:32:35 +03:00
|
|
|
defaultConfiguration =
|
2019-09-25 03:29:44 +03:00
|
|
|
let
|
|
|
|
configPathFromNixPath = (builtins.tryEval <mobile-nixos-configuration>).value;
|
|
|
|
in
|
2021-02-22 01:32:35 +03:00
|
|
|
if configPathFromNixPath != false then
|
|
|
|
[ configPathFromNixPath ]
|
|
|
|
else if configuration != null then
|
|
|
|
[ configuration ]
|
|
|
|
else if (builtins.pathExists ./local.nix) then
|
|
|
|
builtins.trace ''
|
|
|
|
${"\n"}
|
|
|
|
********************************************
|
|
|
|
* WARNING: evaluation includes ./local.nix *
|
|
|
|
********************************************
|
|
|
|
'' [ (import ./local.nix) ]
|
|
|
|
else
|
|
|
|
[]
|
2020-03-13 00:57:57 +03:00
|
|
|
;
|
2018-06-17 02:21:41 +03:00
|
|
|
in
|
2019-09-22 05:40:24 +03:00
|
|
|
|
2021-02-22 01:32:35 +03:00
|
|
|
import ./lib/eval-with-configuration.nix (args // {
|
|
|
|
configuration = defaultConfiguration;
|
|
|
|
additionalHelpInstructions = ''
|
2020-05-26 21:57:17 +03:00
|
|
|
You can build the `-A build.default` attribute to build an empty and
|
|
|
|
un-configured image. That image can be configured using `local.nix`.
|
2021-02-22 01:32:35 +03:00
|
|
|
|
|
|
|
** Note that an unconfigured image may appear to hang at boot. **
|
2019-09-22 05:45:41 +03:00
|
|
|
|
2020-05-28 01:27:40 +03:00
|
|
|
An alternative is to use one of the `examples` system. They differ in their
|
|
|
|
configuration. An example that should be building, and working using
|
|
|
|
cross-compilation is the `examples/hello` system. Read its README for more
|
|
|
|
information.
|
|
|
|
|
2021-02-22 01:32:35 +03:00
|
|
|
$ nix-build examples/hello --argstr device ${device} -A build.default
|
2019-09-22 05:40:24 +03:00
|
|
|
'';
|
2021-02-22 01:32:35 +03:00
|
|
|
})
|