summaryrefslogtreecommitdiff
path: root/router.nix
diff options
context:
space:
mode:
authorMathias Magnusson <mathias@magnusson.space>2025-10-19 17:45:49 +0200
committerMathias Magnusson <mathias@magnusson.space>2025-10-19 17:46:34 +0200
commit671e66917b09c56ca9e717b300b874ed71b189ae (patch)
treec81a03308a7fa7828d49fc29d49f76bfec2e86ea /router.nix
parent421733993cc9f0ce1ec4306cd0659fb5fe655846 (diff)
downloadoden-671e66917b09c56ca9e717b300b874ed71b189ae.tar.gz
nixfmt
Diffstat (limited to 'router.nix')
-rw-r--r--router.nix57
1 files changed, 38 insertions, 19 deletions
diff --git a/router.nix b/router.nix
index 338bc83..1b2eb51 100644
--- a/router.nix
+++ b/router.nix
@@ -16,25 +16,35 @@ in
internalInterfaces = [ "br0" ];
# forwardPorts = [{ sourcePort = 1234; destination = "10.69.0.2:12345"; }];
};
- bridges.br0.interfaces = [ lanInterface wifiInterface ];
- interfaces.br0.ipv4.addresses = [{
- address = "10.69.0.1";
- prefixLength = 16;
- }];
+ bridges.br0.interfaces = [
+ lanInterface
+ wifiInterface
+ ];
+ interfaces.br0.ipv4.addresses = [
+ {
+ address = "10.69.0.1";
+ prefixLength = 16;
+ }
+ ];
networkmanager = {
enable = true;
- unmanaged = [ "interface-name:${lanInterface}" "interface-name:${wifiInterface}" ];
- dispatcherScripts = [ {
- type = "basic";
- source = pkgs.writeScript "dynamic-dns-on-ipv4-change" ''
- #!/bin/sh
+ unmanaged = [
+ "interface-name:${lanInterface}"
+ "interface-name:${wifiInterface}"
+ ];
+ dispatcherScripts = [
+ {
+ type = "basic";
+ source = pkgs.writeScript "dynamic-dns-on-ipv4-change" ''
+ #!/bin/sh
- [ "$1" = "${wanInterface}" ] || exit
- [ "$2" = dhcp4-change ] || exit
- ${pkgs.curl}/bin/curl "$(cat "${config.age.secrets."dyndns-url.txt".path}")"
- date >> /home/mathias/networkmanager-dispatcherScripts-run
- '';
- } ];
+ [ "$1" = "${wanInterface}" ] || exit
+ [ "$2" = dhcp4-change ] || exit
+ ${pkgs.curl}/bin/curl "$(cat "${config.age.secrets."dyndns-url.txt".path}")"
+ date >> /home/mathias/networkmanager-dispatcherScripts-run
+ '';
+ }
+ ];
};
};
services.hostapd = {
@@ -65,11 +75,17 @@ in
domain = "m";
local = "/m/";
- server = [ "1.1.1.1" "1.0.0.1" ];
+ server = [
+ "1.1.1.1"
+ "1.0.0.1"
+ ];
interface = "br0";
dhcp-range = "10.69.0.50,10.69.0.254,255.255.0.0,1h";
- dhcp-option = [ "option:router,10.69.0.1" "option:dns-server,10.69.0.1" ];
+ dhcp-option = [
+ "option:router,10.69.0.1"
+ "option:dns-server,10.69.0.1"
+ ];
dhcp-authoritative = true;
no-hosts = true;
@@ -82,7 +98,10 @@ in
};
};
networking.nameservers = [ "127.0.0.1" ];
- networking.firewall.allowedUDPPorts = [ 53 67 ];
+ networking.firewall.allowedUDPPorts = [
+ 53
+ 67
+ ];
networking.firewall.allowedTCPPorts = [ 53 ];
oden.persist.directories = [ "/var/lib/dnsmasq" ];