2018-06-18 03:50:17 +03:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2018-06-19 05:23:15 +03:00
|
|
|
# This device description is a bit configurable through
|
|
|
|
# mobile options...
|
|
|
|
|
|
|
|
# Enabling the splash changes some settings.
|
|
|
|
splash = config.mobile.boot.stage-1.splash.enable;
|
|
|
|
|
2020-04-23 04:58:00 +03:00
|
|
|
kernel = pkgs.linuxPackages_5_4.kernel;
|
2019-10-07 23:49:24 +03:00
|
|
|
device_info = {
|
2019-11-08 01:30:58 +03:00
|
|
|
name = "QEMU (x86_64)";
|
2019-10-07 23:49:24 +03:00
|
|
|
};
|
2018-06-18 03:50:17 +03:00
|
|
|
|
2018-06-24 00:46:06 +03:00
|
|
|
modules = [
|
|
|
|
# Disk images
|
|
|
|
"ata_piix"
|
|
|
|
"sd_mod"
|
|
|
|
|
|
|
|
# Networking
|
|
|
|
"e1000"
|
2018-06-24 01:47:00 +03:00
|
|
|
|
|
|
|
# Keyboard
|
|
|
|
"hid_generic"
|
|
|
|
"pcips2" "atkbd" "i8042"
|
|
|
|
|
2019-10-05 09:44:15 +03:00
|
|
|
# Mouse
|
|
|
|
"mousedev"
|
|
|
|
|
|
|
|
# Input within X11
|
|
|
|
"uinput" "evdev"
|
|
|
|
|
|
|
|
# USB
|
|
|
|
"usbcore" "usbhid" "ehci_pci" "ehci_hcd"
|
|
|
|
|
2018-06-24 01:47:00 +03:00
|
|
|
# x86 RTC needed by the stage 2 init script.
|
|
|
|
"rtc_cmos"
|
2018-06-18 03:50:17 +03:00
|
|
|
|
2020-04-23 04:58:00 +03:00
|
|
|
# Video
|
|
|
|
"bochs_drm"
|
|
|
|
];
|
2018-06-18 03:50:17 +03:00
|
|
|
in
|
|
|
|
{
|
|
|
|
mobile.device.name = "qemu-x86_64";
|
|
|
|
mobile.device.info = device_info // {
|
|
|
|
# TODO : make kernel part of options.
|
|
|
|
inherit kernel;
|
2020-02-29 07:10:55 +03:00
|
|
|
kernel_cmdline = lib.concatStringsSep " " ([
|
|
|
|
"console=tty1"
|
|
|
|
"console=ttyS0"
|
|
|
|
"vt.global_cursor_default=0"
|
2020-03-10 02:59:12 +03:00
|
|
|
"quiet"
|
|
|
|
]);
|
2018-06-18 03:50:17 +03:00
|
|
|
};
|
2020-04-23 04:58:00 +03:00
|
|
|
|
2018-06-18 03:50:17 +03:00
|
|
|
mobile.hardware = {
|
|
|
|
soc = "generic-x86_64";
|
2020-04-23 04:58:00 +03:00
|
|
|
|
|
|
|
# For the QEMU device, this *sets* the display size.
|
2018-06-18 03:50:17 +03:00
|
|
|
screen = {
|
2020-04-23 04:58:00 +03:00
|
|
|
width = 1080;
|
|
|
|
height = 1920;
|
2018-06-18 03:50:17 +03:00
|
|
|
};
|
2019-10-05 09:44:36 +03:00
|
|
|
ram = 1024 * 2;
|
2018-06-18 03:50:17 +03:00
|
|
|
};
|
2018-06-27 04:52:09 +03:00
|
|
|
|
2018-06-18 03:50:17 +03:00
|
|
|
mobile.system.type = "kernel-initrd";
|
|
|
|
mobile.boot.stage-1 = {
|
2018-06-24 00:46:06 +03:00
|
|
|
kernel = {
|
|
|
|
modular = true;
|
|
|
|
inherit modules;
|
|
|
|
};
|
2018-06-18 03:50:17 +03:00
|
|
|
};
|
|
|
|
}
|