1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-14 18:21:41 +03:00
mobile-nixos/README.adoc

78 lines
1.9 KiB
Plaintext
Raw Normal View History

2019-11-12 00:46:05 +03:00
= Mobile NixOS
2018-06-10 03:45:05 +03:00
2019-09-22 05:46:01 +03:00
*This is expected to be built against the nixos-unstable for now.*
2018-06-10 03:45:05 +03:00
2019-11-12 00:46:05 +03:00
== 2-minutes startup
2019-11-12 00:43:09 +03:00
For an already bootloader-unlocked Android-based, `fastboot`-using device.
```
2019-11-12 00:43:09 +03:00
# Build a boot image
nix-build --argstr device $DEVICE -A build.android-bootimg
# Reboot the phone to fastboot
adb wait-for-device && adb reboot bootloader
2019-11-12 00:43:09 +03:00
# Use fastboot to boot the produced image
fastboot boot result
```
2019-11-12 00:46:05 +03:00
=== Booting qemu
2018-06-18 04:01:57 +03:00
2019-09-22 05:46:01 +03:00
The qemu target has a `vm` build output, which results in a script that will
automatically start the "virtual device".
2018-06-18 04:01:57 +03:00
```
2019-11-12 00:43:09 +03:00
# Build the system
nix-build --argstr device qemu-x86_64 -A build.vm
2019-11-12 00:43:09 +03:00
# Run the VM, using the script
2019-09-22 05:46:01 +03:00
./result
2018-06-18 04:01:57 +03:00
```
2019-11-12 00:46:05 +03:00
=== `local.nix`
2019-09-25 05:57:56 +03:00
This file is used to work on producing build artifacts from the "WIP" repository
checkout. This is equivalent to adding settings in `configuration.nix`.
If the file does not exist, it will not fail.
A sample `local.nix`:
```
{ lib, ... }:
{
mobile.boot.stage-1.splash.enable = false;
}
```
This will disable splash screens.
2019-09-25 05:57:56 +03:00
Note that this can be set to another file with `<mobile-nixos-configuration>`.
By setting it to the path of a nix expression, it will be used instead of using
`local.nix`.
This is the current mechanism expected to be used to create special builds using
the mobile-nixos tooling (e.g. to create a custom special `boot.img`).
2019-11-12 00:46:05 +03:00
== Goals
2018-06-10 03:45:05 +03:00
2019-11-12 00:43:09 +03:00
The goal is to get a NixOS system running on mobile devices, e.g. Android phones.
2018-06-10 03:45:05 +03:00
2019-08-26 17:31:43 +03:00
This is intended as building blocks, allowing the end-users to configure their
systems as desired.
2018-06-10 03:45:05 +03:00
2019-08-26 17:31:43 +03:00
The amount of targeted devices does not dilute or devalue the work. It's the
other way around, it increases the odds that people will start using the project
and contribute back.
2018-06-10 03:45:05 +03:00
2019-11-12 00:46:05 +03:00
== Prior work
2018-06-10 03:45:05 +03:00
2019-08-26 17:31:43 +03:00
This project initially borrowed and relied on the hard work from the
2019-11-12 00:46:05 +03:00
link:https://postmarketos.org/[PostmarketOS project]. They are forever
2019-11-12 00:43:09 +03:00
thanked in their efforts.