2022-10-03 23:28:15 +02:00
|
|
|
# This "device" generates images that can be used with the QEMU
|
|
|
|
# emulator. The default output is a directory containing separate
|
|
|
|
# kernel (uncompressed vmlinux) and initrd (squashfs) images
|
2022-09-20 17:09:44 +02:00
|
|
|
{
|
|
|
|
system = {
|
|
|
|
crossSystem = {
|
|
|
|
config = "mips-unknown-linux-musl";
|
|
|
|
gcc = {
|
|
|
|
abi = "32";
|
|
|
|
arch = "mips32"; # maybe mips_24kc-
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-10-15 19:55:33 +02:00
|
|
|
|
2023-03-01 23:24:58 +01:00
|
|
|
module = {pkgs, config, ... }: {
|
2023-09-20 22:30:18 +02:00
|
|
|
imports = [ ../../modules/arch/mipseb.nix ];
|
2023-02-10 18:54:33 +01:00
|
|
|
kernel = {
|
|
|
|
src = pkgs.pkgsBuildBuild.fetchurl {
|
|
|
|
name = "linux.tar.gz";
|
2023-02-22 19:41:41 +01:00
|
|
|
url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.71.tar.gz";
|
|
|
|
hash = "sha256-yhO2cXIeIgUxkSZf/4aAsF11uxyh+UUZu6D1h92vCD8=";
|
2022-10-15 19:55:33 +02:00
|
|
|
};
|
2023-02-10 18:54:33 +01:00
|
|
|
config = {
|
|
|
|
MIPS_MALTA= "y";
|
|
|
|
CPU_MIPS32_R2= "y";
|
2022-09-21 00:04:08 +02:00
|
|
|
|
2023-04-02 19:49:40 +02:00
|
|
|
MTD = "y";
|
|
|
|
MTD_BLOCK2MTD = "y";
|
|
|
|
MTD_BLKDEVS = "y";
|
|
|
|
MTD_BLOCK = "y";
|
|
|
|
|
2023-02-10 18:54:33 +01:00
|
|
|
VIRTIO_MENU = "y";
|
|
|
|
PCI = "y";
|
|
|
|
VIRTIO_PCI = "y";
|
|
|
|
BLOCK = "y";
|
|
|
|
VIRTIO_BLK = "y";
|
|
|
|
NETDEVICES = "y";
|
|
|
|
VIRTIO_NET = "y";
|
2022-10-18 23:28:07 +02:00
|
|
|
|
2023-02-10 18:54:33 +01:00
|
|
|
SERIAL_8250= "y";
|
|
|
|
SERIAL_8250_CONSOLE= "y";
|
|
|
|
};
|
2022-09-20 19:54:27 +02:00
|
|
|
};
|
2023-03-03 23:52:33 +01:00
|
|
|
hardware =
|
2023-03-01 23:24:58 +01:00
|
|
|
let
|
|
|
|
mac80211 = pkgs.mac80211.override {
|
|
|
|
drivers = ["mac80211_hwsim"];
|
2023-07-13 20:24:59 +02:00
|
|
|
klibBuild = config.system.outputs.kernel.modulesupport;
|
2023-03-01 23:24:58 +01:00
|
|
|
};
|
|
|
|
in {
|
|
|
|
defaultOutput = "vmroot";
|
2023-09-20 19:33:08 +02:00
|
|
|
flash.eraseBlockSize = "65536"; # c.f. pkgs/run-liminix-vm/run-liminix-vm.sh
|
2023-09-01 00:50:42 +02:00
|
|
|
networkInterfaces =
|
|
|
|
let inherit (config.system.service.network) link;
|
|
|
|
in {
|
2023-09-01 18:54:15 +02:00
|
|
|
wan = link.build { ifname = "eth0"; };
|
|
|
|
lan = link.build { ifname = "eth1"; };
|
2023-03-01 23:24:58 +01:00
|
|
|
|
2023-09-01 00:50:42 +02:00
|
|
|
wlan_24 = link.build {
|
|
|
|
ifname = "wlan0";
|
|
|
|
dependencies = [ mac80211 ];
|
|
|
|
};
|
2023-03-01 23:24:58 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-09-20 19:54:27 +02:00
|
|
|
};
|
2022-09-20 17:09:44 +02:00
|
|
|
}
|