rename "device" config tree as "hardware"
we are also using "device" for "network device" (as in eth0, wlan0 etc) so this makes it a bit less confusing perhaps
This commit is contained in:
parent
263882cbe4
commit
e0ea576674
10 changed files with 38 additions and 37 deletions
|
@ -40,7 +40,7 @@ let
|
|||
}).config.system;
|
||||
in {
|
||||
outputs = config.outputs // {
|
||||
default = config.outputs.${config.device.defaultOutput};
|
||||
default = config.outputs.${config.hardware.defaultOutput};
|
||||
};
|
||||
|
||||
# this is just here as a convenience, so that we can get a
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
inherit (pkgs.pseudofile) dir symlink;
|
||||
inherit (pkgs.liminix.networking) interface;
|
||||
in {
|
||||
device = {
|
||||
hardware = {
|
||||
defaultOutput = "tftproot";
|
||||
loadAddress = "0x80060000";
|
||||
entryPoint = "0x80060000";
|
||||
|
@ -96,6 +96,12 @@
|
|||
size ="0xfa0000";
|
||||
};
|
||||
rootDevice = "1f05";
|
||||
dts = {
|
||||
src = "${openwrt}/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts";
|
||||
includes = [
|
||||
"${openwrt}/target/linux/ath79/dts"
|
||||
];
|
||||
};
|
||||
|
||||
networkInterfaces = {
|
||||
lan = interface { device = "eth0"; };
|
||||
|
@ -125,12 +131,6 @@
|
|||
boot.tftp = {
|
||||
loadAddress = "0x00A00000";
|
||||
};
|
||||
device.dts = {
|
||||
src = "${openwrt}/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts";
|
||||
includes = [
|
||||
"${openwrt}/target/linux/ath79/dts"
|
||||
];
|
||||
};
|
||||
kernel = {
|
||||
src = pkgs.pkgsBuildBuild.fetchurl {
|
||||
name = "linux.tar.gz";
|
||||
|
|
|
@ -21,21 +21,21 @@
|
|||
hash = "sha256-YYi4gkpLjbOK7bM2MGQjAyEBuXJ9JNXoz/JEmYf8xE8=";
|
||||
};
|
||||
in {
|
||||
device = {
|
||||
hardware = {
|
||||
defaultOutput = "tftproot";
|
||||
loadAddress = "0x80000000";
|
||||
entryPoint = "0x80000000";
|
||||
radios = ["rt2800soc"];
|
||||
};
|
||||
boot.tftp = {
|
||||
loadAddress = "0x00A00000";
|
||||
};
|
||||
device.dts = {
|
||||
dts = {
|
||||
src = "${openwrt}/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts";
|
||||
includes = [
|
||||
"${openwrt}/target/linux/ramips/dts"
|
||||
];
|
||||
};
|
||||
};
|
||||
boot.tftp = {
|
||||
loadAddress = "0x00A00000";
|
||||
};
|
||||
|
||||
kernel = {
|
||||
src = pkgs.fetchurl {
|
||||
|
|
|
@ -21,21 +21,22 @@
|
|||
hash = "sha256-YYi4gkpLjbOK7bM2MGQjAyEBuXJ9JNXoz/JEmYf8xE8=";
|
||||
};
|
||||
in {
|
||||
device = {
|
||||
hardware = {
|
||||
defaultOutput = "tftproot";
|
||||
loadAddress = "0x80000000";
|
||||
entryPoint = "0x80000000";
|
||||
radios = ["mt7603e"];
|
||||
};
|
||||
boot.tftp = {
|
||||
loadAddress = "0x00A00000";
|
||||
};
|
||||
device.dts = {
|
||||
dts = {
|
||||
src = "${openwrt}/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts";
|
||||
includes = [
|
||||
"${openwrt}/target/linux/ramips/dts"
|
||||
];
|
||||
};
|
||||
};
|
||||
boot.tftp = {
|
||||
loadAddress = "0x00A00000";
|
||||
};
|
||||
|
||||
|
||||
kernel = {
|
||||
src = pkgs.fetchurl {
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
SERIAL_8250_CONSOLE= "y";
|
||||
};
|
||||
};
|
||||
device =
|
||||
hardware =
|
||||
let
|
||||
mac80211 = pkgs.mac80211.override {
|
||||
drivers = ["mac80211_hwsim"];
|
||||
|
|
|
@ -22,7 +22,7 @@ in {
|
|||
};
|
||||
|
||||
boot.commandLine = [
|
||||
"root=${config.device.rootDevice}"
|
||||
"root=${config.hardware.rootDevice}"
|
||||
];
|
||||
outputs.firmware =
|
||||
let o = config.outputs; in
|
||||
|
@ -49,7 +49,7 @@ in {
|
|||
let
|
||||
inherit (pkgs.lib.trivial) toHexString;
|
||||
inherit (pkgs.lib.lists) concatStringsSep;
|
||||
inherit (config.device) flash;
|
||||
inherit (config.hardware) flash;
|
||||
in
|
||||
pkgs.buildPackages.runCommand "" {} ''
|
||||
imageSize=$(stat -L -c %s ${config.outputs.firmware})
|
||||
|
|
|
@ -5,7 +5,7 @@ in {
|
|||
options = {
|
||||
boot = {
|
||||
};
|
||||
device = {
|
||||
hardware = {
|
||||
dts = {
|
||||
src = mkOption { type = types.path; };
|
||||
includes = mkOption {
|
||||
|
|
|
@ -24,14 +24,14 @@ in
|
|||
};
|
||||
dtb = (callPackage ../kernel/dtb.nix {}) {
|
||||
inherit (config.boot) commandLine;
|
||||
dts = config.device.dts.src;
|
||||
includes = config.device.dts.includes ++ [
|
||||
dts = config.hardware.dts.src;
|
||||
includes = config.hardware.dts.includes ++ [
|
||||
"${kernel.headers}/include"
|
||||
];
|
||||
};
|
||||
uimage = (callPackage ../kernel/uimage.nix {}) {
|
||||
commandLine = concatStringsSep " " config.boot.commandLine;
|
||||
inherit (config.device) loadAddress entryPoint;
|
||||
inherit (config.hardware) loadAddress entryPoint;
|
||||
inherit kernel;
|
||||
inherit dtb;
|
||||
};
|
||||
|
|
14
rotuer.nix
14
rotuer.nix
|
@ -83,7 +83,7 @@ in rec {
|
|||
};
|
||||
};
|
||||
|
||||
services.hostap = hostapd (config.device.networkInterfaces.wlan_24) {
|
||||
services.hostap = hostapd (config.hardware.networkInterfaces.wlan_24) {
|
||||
params = {
|
||||
ssid = "liminix";
|
||||
country_code = "GB";
|
||||
|
@ -100,7 +100,7 @@ in rec {
|
|||
};
|
||||
};
|
||||
|
||||
services.hostap5 = hostapd (config.device.networkInterfaces.wlan_5) {
|
||||
services.hostap5 = hostapd (config.hardware.networkInterfaces.wlan_5) {
|
||||
params = rec {
|
||||
ssid = "liminix_5";
|
||||
country_code = "GB";
|
||||
|
@ -142,9 +142,9 @@ in rec {
|
|||
in bundle {
|
||||
name = "bridge-members";
|
||||
contents = map addif [
|
||||
config.device.networkInterfaces.wlan_24
|
||||
config.device.networkInterfaces.lan
|
||||
config.device.networkInterfaces.wlan_5
|
||||
config.hardware.networkInterfaces.wlan_24
|
||||
config.hardware.networkInterfaces.lan
|
||||
config.hardware.networkInterfaces.wlan_5
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -167,7 +167,7 @@ in rec {
|
|||
};
|
||||
|
||||
services.wan =
|
||||
let iface = config.device.networkInterfaces.wan;
|
||||
let iface = config.hardware.networkInterfaces.wan;
|
||||
in pppoe iface {
|
||||
ppp-options = [
|
||||
"debug" "+ipv6" "noauth"
|
||||
|
@ -213,7 +213,7 @@ in rec {
|
|||
name = "default";
|
||||
contents = with services; [
|
||||
loopback
|
||||
config.device.networkInterfaces.lan
|
||||
config.hardware.networkInterfaces.lan
|
||||
int
|
||||
bridge
|
||||
hostap
|
||||
|
|
|
@ -15,7 +15,7 @@ in rec {
|
|||
|
||||
imports = [ ../../modules/wlan.nix ];
|
||||
|
||||
services.wlan = config.device.networkInterfaces.wlan_24;
|
||||
services.wlan = config.hardware.networkInterfaces.wlan_24;
|
||||
|
||||
services.hostap = hostapd (services.wlan) {
|
||||
params = {
|
||||
|
|
Loading…
Reference in a new issue