1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-09-19 07:47:20 +03:00
mobile-nixos/default.nix

45 lines
1.2 KiB
Nix
Raw Normal View History

{ device ? null
, configuration ? null
, pkgs ? (import ./pkgs.nix {})
}@args':
2019-09-21 22:40:46 +03:00
let
# Inherit default values correctly in `args`
args = args' // {
inherit pkgs;
};
defaultConfiguration =
if configuration != null then
configuration
else if (builtins.pathExists ./local.nix) then
builtins.trace ''
${"\n"}
********************************************
* WARNING: evaluation includes ./local.nix *
********************************************
'' ./local.nix
else
{}
;
in
import ./lib/eval-with-configuration.nix (args // {
configuration = [
defaultConfiguration
];
additionalHelpInstructions = ''
2021-08-27 08:20:16 +03:00
You can build the `-A outputs.default` attribute to build an empty and
un-configured image. That image can be configured using `local.nix`.
** Note that an unconfigured image may appear to hang at boot. **
2019-09-22 05:45:41 +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
'';
})