1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2025-01-07 12:11:28 +03:00
mobile-nixos/modules/system-types/android.nix

33 lines
791 B
Nix
Raw Normal View History

2019-09-22 05:42:26 +03:00
{ config, pkgs, lib, ... }:
let
device_config = config.mobile.device;
device_name = device_config.name;
2019-09-22 05:42:26 +03:00
enabled = config.mobile.system.type == "android";
inherit (config.system.build) rootfs;
2019-09-22 05:42:26 +03:00
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
'';
2019-09-22 05:42:26 +03:00
in
{
config = lib.mkMerge [
{ mobile.system.types = [ "android" ]; }
(lib.mkIf enabled {
system.build = {
inherit android-bootimg android-device;
mobile-installer = throw "No installer yet...";
};
})
];
}