forked from mobile-nixos/mobile-nixos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
44 lines (38 loc) · 1.22 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ device ? null
, configuration ? null
, pkgs ? (import ./pkgs.nix {})
}@args':
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 = ''
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. **
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.
$ nix-build examples/hello --argstr device ${device} -A outputs.default
'';
})