128 lines
3.5 KiB
Nix
128 lines
3.5 KiB
Nix
# GL.iNet GL-MT6000
|
|
{ inputs }:
|
|
{
|
|
system = {
|
|
crossSystem = {
|
|
config = "aarch64-unknown-linux-musl";
|
|
gcc = {
|
|
arch = "armv8-a";
|
|
};
|
|
};
|
|
};
|
|
|
|
description = ''
|
|
Device configuration for Yada/White house router.
|
|
'';
|
|
|
|
module =
|
|
{
|
|
pkgs,
|
|
config,
|
|
lib,
|
|
lim,
|
|
...
|
|
}:
|
|
let
|
|
inherit (pkgs) openwrt_24_10;
|
|
# mac80211 = pkgs.kmodloader.override {
|
|
# targets = [ "rt2800soc" ];
|
|
# inherit (config.system.outputs) kernel;
|
|
# };
|
|
in
|
|
{
|
|
imports = [
|
|
"${inputs.liminix}/modules/outputs/mtdimage.nix"
|
|
"${inputs.liminix}/modules/outputs/squashfs.nix"
|
|
"${inputs.liminix}/modules/outputs/tftpboot.nix"
|
|
"${inputs.liminix}/modules/outputs/vmroot.nix"
|
|
"${inputs.liminix}/modules/arch/aarch64.nix"
|
|
# "${inputs.liminix}/modules/base.nix"
|
|
"${inputs.liminix}/modules/vlan"
|
|
];
|
|
boot.tftp = {
|
|
serverip = "192.168.1.254";
|
|
ipaddr = "192.168.1.1";
|
|
loadAddress = lim.parseInt "0x46000000";
|
|
};
|
|
boot.imageFormat = "fit";
|
|
boot.loader.fit.enable = true;
|
|
rootfsType = "squashfs";
|
|
hardware = {
|
|
loadAddress = lim.parseInt "0x48080000";
|
|
entryPoint = lim.parseInt "0x48080000";
|
|
|
|
flash = {
|
|
address = lim.parseInt "0x41e00000";
|
|
size = lim.parseInt "0x4000";
|
|
eraseBlockSize = 65536;
|
|
};
|
|
rootDevice = "/dev/root";
|
|
|
|
dts = {
|
|
src = "${openwrt_24_10.src}/target/linux/mediatek/dts/mt7986a-glinet-gl-mt6000.dts";
|
|
includePaths = [
|
|
"${openwrt_24_10.src}/target/linux/mediatek/dts"
|
|
"${config.system.outputs.kernel.modulesupport}/arch/arm64/boot/dts/mediatek/"
|
|
];
|
|
};
|
|
networkInterfaces =
|
|
let
|
|
inherit (config.system.service.network) link;
|
|
inherit (config.system.service) vlan;
|
|
in
|
|
rec {
|
|
eth0 = link.build { ifname = "eth0"; };
|
|
wan = link.build { ifname = "eth1"; };
|
|
|
|
lan1 = vlan.build {
|
|
ifname = "lan1@eth0";
|
|
primary = eth0;
|
|
vid = "1";
|
|
};
|
|
lan2 = vlan.build {
|
|
ifname = "lan2@eth0";
|
|
primary = eth0;
|
|
vid = "2";
|
|
};
|
|
lan3 = vlan.build {
|
|
ifname = "lan3@eth0";
|
|
primary = eth0;
|
|
vid = "3";
|
|
};
|
|
lan4 = vlan.build {
|
|
ifname = "lan4@eth0";
|
|
primary = eth0;
|
|
vid = "4";
|
|
};
|
|
lan5 = vlan.build {
|
|
ifname = "lan5@eth0";
|
|
primary = eth0;
|
|
vid = "5";
|
|
};
|
|
|
|
# wlan = link.build {
|
|
# ifname = "wlan0";
|
|
# dependencies = [ mac80211 ];
|
|
# };
|
|
};
|
|
};
|
|
|
|
kernel = {
|
|
src = openwrt_24_10.kernelSrc;
|
|
version = openwrt_24_10.kernelVersion;
|
|
extraPatchPhase = ''
|
|
echo ==================================================
|
|
ls ${openwrt_24_10.src}/config
|
|
echo ==================================================
|
|
patch ${openwrt_24_10.src}/package/boot/uboot-mediatek/patches/436-add-glinet-mt6000.patch
|
|
echo --------------------------------------------------
|
|
ls ${openwrt_24_10.src}/config
|
|
echo --------------------------------------------------
|
|
${openwrt_24_10.applyPatches.mediatek}
|
|
'';
|
|
config = {
|
|
};
|
|
};
|
|
};
|
|
}
|