mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-11-28 12:56:54 +03:00
47 lines
1.0 KiB
Nix
47 lines
1.0 KiB
Nix
|
{
|
||
|
config
|
||
|
, pkgs
|
||
|
}:
|
||
|
with pkgs;
|
||
|
let
|
||
|
device_config = config.mobile.device;
|
||
|
hardware_config = config.mobile.hardware;
|
||
|
|
||
|
inherit (config.mobile.boot) stage-1;
|
||
|
|
||
|
inherit (hardware_config) ram;
|
||
|
device_name = device_config.name;
|
||
|
device_info = device_config.info;
|
||
|
|
||
|
android-bootimg = pkgs.callPackage ./bootimg.nix {
|
||
|
inherit device_config;
|
||
|
initrd = pkgs.callPackage ./initrd.nix { inherit device_config stage-1; };
|
||
|
};
|
||
|
android-system =
|
||
|
(
|
||
|
(import (pkgs.path + "/nixos"))
|
||
|
{
|
||
|
#system = "armv7l-linux";
|
||
|
#system = config.nixpkgs.pkgs.targetPlatform.system;
|
||
|
configuration = import (./system-android.nix) { mobile_config = config; };
|
||
|
}
|
||
|
).config.system.build.systemImage
|
||
|
;
|
||
|
in
|
||
|
stdenv.mkDerivation {
|
||
|
name = "nixos-mobile_${device_name}_combined";
|
||
|
|
||
|
src = builtins.filterSource (path: type: false) ./.;
|
||
|
unpackPhase = "true";
|
||
|
|
||
|
buildInputs = [
|
||
|
linux
|
||
|
];
|
||
|
|
||
|
installPhase = ''
|
||
|
mkdir -p $out/
|
||
|
cp ${android-bootimg} $out/boot.img
|
||
|
cp ${android-system} $out/system.img
|
||
|
'';
|
||
|
}
|