2021-08-26 23:31:21 +03:00
|
|
|
{ device ? null
|
|
|
|
, configuration ? null
|
|
|
|
, pkgs ? (import ./pkgs.nix {})
|
|
|
|
}@args':
|
2019-09-21 22:40:46 +03:00
|
|
|
|
2021-02-22 01:32:35 +03:00
|
|
|
let
|
2021-08-26 23:31:21 +03:00
|
|
|
# Inherit default values correctly in `args`
|
|
|
|
args = args' // {
|
|
|
|
inherit pkgs;
|
|
|
|
};
|
|
|
|
|
2021-02-22 01:32:35 +03:00
|
|
|
defaultConfiguration =
|
2023-09-12 00:58:09 +03:00
|
|
|
if configuration != null then
|
|
|
|
configuration
|
2021-02-22 01:32:35 +03:00
|
|
|
else if (builtins.pathExists ./local.nix) then
|
|
|
|
builtins.trace ''
|
|
|
|
${"\n"}
|
|
|
|
********************************************
|
|
|
|
* WARNING: evaluation includes ./local.nix *
|
|
|
|
********************************************
|
2023-09-12 00:58:09 +03:00
|
|
|
'' ./local.nix
|
2021-02-22 01:32:35 +03:00
|
|
|
else
|
2023-09-12 00:58:09 +03:00
|
|
|
{}
|
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 // {
|
2023-09-12 00:58:09 +03:00
|
|
|
configuration = [
|
|
|
|
defaultConfiguration
|
|
|
|
];
|
2021-02-22 01:32:35 +03:00
|
|
|
additionalHelpInstructions = ''
|
2021-08-27 08:20:16 +03:00
|
|
|
You can build the `-A outputs.default` attribute to build an empty and
|
2020-05-26 21:57:17 +03:00
|
|
|
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-08-27 08:20:16 +03:00
|
|
|
$ nix-build examples/hello --argstr device ${device} -A outputs.default
|
2019-09-22 05:40:24 +03:00
|
|
|
'';
|
2021-02-22 01:32:35 +03:00
|
|
|
})
|