-
Notifications
You must be signed in to change notification settings - Fork 39
/
default.nix
59 lines (58 loc) · 1.64 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{ configuration ? import ./configuration.nix
, nixpkgs ? <nixpkgs>
, extraModules ? []
, system ? builtins.currentSystem
, platform ? null
, crossSystem ? null }:
let
pkgs = import nixpkgs { inherit system; platform = platform; config = {}; };
pkgsModule = {config, ... }: {
_file = ./default.nix;
key = ./default.nix;
config = {
nixpkgs.pkgs = (import nixpkgs {
inherit system crossSystem;
#crossSystem = (import <nixpkgs/lib>).systems.examples.aarch64-multiplatform;
config = config.nixpkgs.config;
overlays = config.nixpkgs.overlays;
});
nixpkgs.localSystem = {
inherit system;
} // pkgs.lib.optionalAttrs (crossSystem != null) {
inherit crossSystem;
};
};
};
baseModules = [
./base.nix
./system-path.nix
./stage-1.nix
./stage-2.nix
./runit.nix
(nixpkgs + "/nixos/modules/system/etc/etc.nix")
(nixpkgs + "/nixos/modules/system/activation/activation-script.nix")
(nixpkgs + "/nixos/modules/misc/nixpkgs.nix")
(nixpkgs + "/nixos/modules/system/boot/kernel.nix")
(nixpkgs + "/nixos/modules/misc/assertions.nix")
(nixpkgs + "/nixos/modules/misc/lib.nix")
(nixpkgs + "/nixos/modules/config/sysctl.nix")
./ipxe.nix
./systemd-compat.nix
pkgsModule
];
other = {
_module.check = true;
_module.args = {};
};
evalConfig = modules: pkgs.lib.evalModules {
prefix = [];
modules = modules ++ baseModules ++ [ pkgsModule other ] ++ extraModules;
};
in
rec {
test1 = evalConfig [
configuration
];
runner = test1.config.system.build.runvm;
config = test1.config;
}