mob next [ci-skip] [ci skip] [skip ci]
lastFile:routers/white-house/secrets.nix
This commit is contained in:
@@ -23,7 +23,6 @@ rec {
|
|||||||
imports = [
|
imports = [
|
||||||
"${inputs.liminix}/modules/wlan.nix"
|
"${inputs.liminix}/modules/wlan.nix"
|
||||||
"${inputs.liminix}/modules/network"
|
"${inputs.liminix}/modules/network"
|
||||||
"${inputs.liminix}/modules/ntp"
|
|
||||||
"${inputs.liminix}/modules/vlan"
|
"${inputs.liminix}/modules/vlan"
|
||||||
"${inputs.liminix}/modules/ssh"
|
"${inputs.liminix}/modules/ssh"
|
||||||
"${inputs.liminix}/modules/bridge"
|
"${inputs.liminix}/modules/bridge"
|
||||||
@@ -34,17 +33,33 @@ rec {
|
|||||||
boot = {
|
boot = {
|
||||||
tftp = {
|
tftp = {
|
||||||
freeSpaceBytes = 3 * 1024 * 1024;
|
freeSpaceBytes = 3 * 1024 * 1024;
|
||||||
serverip = "192.168.8.148";
|
serverip = "${secrets.lan.prefix}.148";
|
||||||
ipaddr = "192.168.8.251";
|
ipaddr = "${secrets.lan.prefix}.251";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.sshd = svc.ssh.build {
|
||||||
|
authorizedKeys.root = secrets.root.openssh.authorizedKeys.keys;
|
||||||
|
};
|
||||||
|
|
||||||
|
users.root = secrets.root;
|
||||||
|
|
||||||
|
services.resolvconf = lib.mkForce (
|
||||||
|
pkgs.liminix.services.oneshot rec {
|
||||||
|
name = "resolvconf";
|
||||||
|
up = ''
|
||||||
|
( in_outputs ${name}
|
||||||
|
echo "nameserver $(output ${config.services.wan} ns1)" > resolv.conf
|
||||||
|
echo "nameserver $(output ${config.services.wan} ns2)" >> resolv.conf
|
||||||
|
chmod 0444 resolv.conf
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
profile.gateway = {
|
profile.gateway = {
|
||||||
lan = {
|
lan = {
|
||||||
interfaces = with config.hardware.networkInterfaces; [
|
interfaces = with config.hardware.networkInterfaces; [
|
||||||
# EDIT: these are the interfaces exposed by the gl.inet gl-ar750:
|
|
||||||
# if your device has more or differently named lan interfaces,
|
|
||||||
# specify them here
|
|
||||||
wlan
|
wlan
|
||||||
wlan5
|
wlan5
|
||||||
lan
|
lan
|
||||||
@@ -58,24 +73,17 @@ rec {
|
|||||||
dhcp = {
|
dhcp = {
|
||||||
start = 10;
|
start = 10;
|
||||||
end = 240;
|
end = 240;
|
||||||
hosts =
|
hosts = { };
|
||||||
{ } // lib.optionalAttrs (builtins.pathExists ./static-leases.nix) (import ./static-leases.nix);
|
|
||||||
localDomain = "lan";
|
localDomain = "lan";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
wan = {
|
wan = {
|
||||||
# wan interface depends on your upstream - could be dhcp, static
|
|
||||||
# ethernet, a pppoe, ppp over serial, a complicated bonded
|
|
||||||
# failover ... who knows what else?
|
|
||||||
interface = svc.pppoe.build {
|
interface = svc.pppoe.build {
|
||||||
interface = config.hardware.networkInterfaces.wan;
|
interface = config.hardware.networkInterfaces.wan;
|
||||||
username = secrets.l2tp.name;
|
username = secrets.l2tp.name;
|
||||||
password = secrets.l2tp.password;
|
password = secrets.l2tp.password;
|
||||||
bandwidth = 70 * 1000 * 1000;
|
|
||||||
};
|
};
|
||||||
# once the wan has ipv4 connnectivity, should we run dhcp6
|
|
||||||
# client to potentially get an address range ("prefix
|
|
||||||
# delegation")
|
|
||||||
dhcp6.enable = true;
|
dhcp6.enable = true;
|
||||||
};
|
};
|
||||||
firewall = {
|
firewall = {
|
||||||
@@ -83,9 +91,6 @@ rec {
|
|||||||
rules = secrets.firewallRules;
|
rules = secrets.firewallRules;
|
||||||
};
|
};
|
||||||
wireless.networks = {
|
wireless.networks = {
|
||||||
# EDIT: if you have more or fewer wireless radios, here is where
|
|
||||||
# you need to say so. hostapd tuning is hardware-specific and
|
|
||||||
# left as an exercise for the reader :-).
|
|
||||||
|
|
||||||
"${secrets.ssid}" = {
|
"${secrets.ssid}" = {
|
||||||
interface = config.hardware.networkInterfaces.wlan;
|
interface = config.hardware.networkInterfaces.wlan;
|
||||||
@@ -94,7 +99,7 @@ rec {
|
|||||||
ieee80211n = 1;
|
ieee80211n = 1;
|
||||||
}
|
}
|
||||||
// wirelessConfig;
|
// wirelessConfig;
|
||||||
"${secrets.ssid}5" = rec {
|
"${secrets.ssid}-5" = rec {
|
||||||
interface = config.hardware.networkInterfaces.wlan5;
|
interface = config.hardware.networkInterfaces.wlan5;
|
||||||
hw_mode = "a";
|
hw_mode = "a";
|
||||||
channel = 36;
|
channel = 36;
|
||||||
@@ -109,19 +114,8 @@ rec {
|
|||||||
};
|
};
|
||||||
defaultProfile.packages = with pkgs; [
|
defaultProfile.packages = with pkgs; [
|
||||||
busybox
|
busybox
|
||||||
tcpdump
|
iw
|
||||||
socat
|
|
||||||
iptables
|
iptables
|
||||||
usbutils
|
|
||||||
(levitate.override {
|
|
||||||
config = {
|
|
||||||
services = {
|
|
||||||
inherit (config.services) dhcp6c sshd watchdog;
|
|
||||||
};
|
|
||||||
defaultProfile.packages = [ mtdutils ];
|
|
||||||
users.root = config.users.root;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,18 +1,17 @@
|
|||||||
{
|
{
|
||||||
wpa_passphrase = "";
|
wpa_passphrase = "";
|
||||||
ssid = "Yada";
|
ssid = "WhiteHouse";
|
||||||
l2tp = {
|
l2tp = {
|
||||||
name = "";
|
name = "";
|
||||||
password = "";
|
password = "";
|
||||||
};
|
};
|
||||||
root = {
|
root = {
|
||||||
passwd = "";
|
|
||||||
openssh.authorizedKeys.keys = [
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEcZ/p1Ofa9liwIzPWzNtONhJ7+FUWd2lCz33r81t8+w kurogeek@kurogeek"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
lan = {
|
lan = {
|
||||||
prefix = "192.168.8";
|
prefix = "192.168.1";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
BIN
run-vm-WVbDDP
Normal file
BIN
run-vm-WVbDDP
Normal file
Binary file not shown.
BIN
run-vm-fA0cUs
Normal file
BIN
run-vm-fA0cUs
Normal file
Binary file not shown.
Reference in New Issue
Block a user