From 102fe8f3efff77145256d310064966c60cd6d9e7 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sat, 30 Dec 2023 16:26:38 +0100 Subject: [PATCH] Replace dhcpd4 with dnsmasq --- modules/hardware/raspi4/raspi-usb.nix | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/hardware/raspi4/raspi-usb.nix b/modules/hardware/raspi4/raspi-usb.nix index 7c34028..4678d3f 100644 --- a/modules/hardware/raspi4/raspi-usb.nix +++ b/modules/hardware/raspi4/raspi-usb.nix @@ -49,19 +49,19 @@ in }; networking.dhcpcd.denyInterfaces = [ "usb0" ]; - services.dhcpd4 = { + services.dnsmasq = { enable = true; - interfaces = [ "usb0" ]; - extraConfig = '' - option domain-name "2li.mobile"; - option subnet-mask 255.255.255.0; - option broadcast-address 10.213.0.255; - option domain-name-servers 84.200.69.80, 84.200.70.40; - subnet 10.213.0.0 netmask 255.255.255.0 { - option routers ${cfg.ip}; - range 10.213.0.100 10.213.0.200; - } - ''; + settings = { + domain = "2li.mobile"; + domain-needed = true; + dhcp-range = [ "10.213.0.100,10.213.0.200,255.255.255.0,24h" ]; + dhcp-option = [ "option:router,${cfg.ip}" ]; + interface = "usb0"; + server = [ + "84.200.69.80" + "84.200.70.40" + ]; + }; }; systemd.services."usb-otg" = {