mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-15 19:23:01 +03:00
3cdecd5c00
Can be flashed ``` fastboot flash system result/system.img fastboot flash boot result/boot.img ```
33 lines
791 B
Nix
33 lines
791 B
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
let
|
|
device_config = config.mobile.device;
|
|
device_name = device_config.name;
|
|
enabled = config.mobile.system.type == "android";
|
|
|
|
inherit (config.system.build) rootfs;
|
|
|
|
android-bootimg = pkgs.callPackage ../../systems/bootimg.nix {
|
|
inherit device_config;
|
|
initrd = config.system.build.initrd;
|
|
};
|
|
|
|
android-device = pkgs.runCommandNoCC "android-device-${device_name}" {} ''
|
|
mkdir -p $out
|
|
ln -s ${rootfs}/${rootfs.filename} $out/system.img
|
|
ln -s ${android-bootimg} $out/boot.img
|
|
'';
|
|
in
|
|
{
|
|
config = lib.mkMerge [
|
|
{ mobile.system.types = [ "android" ]; }
|
|
|
|
(lib.mkIf enabled {
|
|
system.build = {
|
|
inherit android-bootimg android-device;
|
|
mobile-installer = throw "No installer yet...";
|
|
};
|
|
})
|
|
];
|
|
}
|