1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-15 19:23:01 +03:00
mobile-nixos/modules/system-types/android.nix
Samuel Dionne-Riel 3cdecd5c00 android: working system.img/boot.img output
Can be flashed

```
fastboot flash system result/system.img
fastboot flash boot result/boot.img
```
2019-09-21 23:21:12 -04:00

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...";
};
})
];
}