2023-12-09 17:42:45 +01:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
{
|
2023-12-10 17:38:53 +01:00
|
|
|
imports = [
|
|
|
|
../../modules/outputs/jffs2.nix
|
|
|
|
];
|
2023-12-09 17:42:45 +01:00
|
|
|
config = {
|
|
|
|
kernel = {
|
|
|
|
src = pkgs.pkgsBuildBuild.fetchurl {
|
|
|
|
name = "linux.tar.gz";
|
2024-01-25 12:29:03 +01:00
|
|
|
url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.137.tar.gz";
|
|
|
|
hash = "sha256-PkdzUKZ0IpBiWe/RS70J76JKnBFzRblWcKlaIFNxnHQ=";
|
2023-12-09 17:42:45 +01:00
|
|
|
};
|
|
|
|
config = {
|
|
|
|
MTD = "y";
|
|
|
|
MTD_BLOCK = "y";
|
|
|
|
MTD_CMDLINE_PARTS = "y";
|
|
|
|
MTD_PHRAM = "y";
|
|
|
|
|
|
|
|
VIRTIO_MENU = "y";
|
|
|
|
PCI = "y";
|
|
|
|
VIRTIO_PCI = "y";
|
|
|
|
BLOCK = "y";
|
|
|
|
VIRTIO_BLK = "y";
|
|
|
|
VIRTIO_NET = "y";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
hardware =
|
|
|
|
let
|
|
|
|
mac80211 = pkgs.mac80211.override {
|
|
|
|
drivers = ["mac80211_hwsim"];
|
|
|
|
klibBuild = config.system.outputs.kernel.modulesupport;
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
defaultOutput = "vmroot";
|
|
|
|
rootDevice = "/dev/mtdblock0";
|
2023-12-21 20:17:14 +01:00
|
|
|
dts.src = pkgs.lib.mkDefault null;
|
2023-12-09 17:42:45 +01:00
|
|
|
flash.eraseBlockSize = 65536;
|
|
|
|
networkInterfaces =
|
|
|
|
let inherit (config.system.service.network) link;
|
|
|
|
in {
|
|
|
|
wan = link.build {
|
|
|
|
devpath = "/devices/pci0000:00/0000:00:13.0/virtio0";
|
|
|
|
ifname = "wan";
|
|
|
|
};
|
|
|
|
lan = link.build {
|
|
|
|
devpath = "/devices/pci0000:00/0000:00:14.0/virtio1";
|
|
|
|
ifname = "lan";
|
|
|
|
};
|
|
|
|
|
|
|
|
wlan_24 = link.build {
|
|
|
|
ifname = "wlan0";
|
|
|
|
dependencies = [ mac80211 ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|