add option to provide dnsmasq resolv-file from a service

This commit is contained in:
Daniel Barlow 2023-02-25 22:53:50 +00:00
parent 59ce03630a
commit c37332910a

View file

@ -7,6 +7,7 @@
{ {
user ? "dnsmasq" user ? "dnsmasq"
, group ? "system" , group ? "system"
, resolvconf ? null
, interface , interface
, upstreams ? [] , upstreams ? []
, ranges , ranges
@ -30,10 +31,12 @@ in longrun {
${lib.concatStringsSep " " (builtins.map (r: "--server=${r}") upstreams)} \ ${lib.concatStringsSep " " (builtins.map (r: "--server=${r}") upstreams)} \
--keep-in-foreground \ --keep-in-foreground \
--dhcp-authoritative \ --dhcp-authoritative \
--no-resolv \ ${if resolvconf != null then "--resolv-file=$(output_path ${resolvconf} resolv.conf)" else "--no-resolv"} \
--no-hosts \
--log-dhcp \ --log-dhcp \
--enable-ra \ --enable-ra \
--log-debug \ --log-debug \
--log-queries \
--log-facility=- \ --log-facility=- \
--dhcp-leasefile=/run/${name}.leases \ --dhcp-leasefile=/run/${name}.leases \
--pid-file=/run/${name}.pid --pid-file=/run/${name}.pid