nixfmt-rfc-style
There is nothing in this commit except for the changes made by nix-shell -p nixfmt-rfc-style --run "nixfmt ." If this has mucked up your open branches then sorry about that. You can probably nixfmt them to match before merging
This commit is contained in:
@@ -1,26 +1,35 @@
|
||||
{
|
||||
liminix
|
||||
, dnsmasq
|
||||
, serviceFns
|
||||
, lib
|
||||
liminix,
|
||||
dnsmasq,
|
||||
serviceFns,
|
||||
lib,
|
||||
}:
|
||||
{
|
||||
interface
|
||||
, user
|
||||
, domain
|
||||
, group
|
||||
, ranges
|
||||
, hosts
|
||||
, upstreams
|
||||
, resolvconf
|
||||
interface,
|
||||
user,
|
||||
domain,
|
||||
group,
|
||||
ranges,
|
||||
hosts,
|
||||
upstreams,
|
||||
resolvconf,
|
||||
}:
|
||||
let
|
||||
name = "${interface.name}.dnsmasq";
|
||||
inherit (liminix.services) longrun;
|
||||
inherit (lib) concatStrings concatStringsSep mapAttrsToList;
|
||||
hostOpt = name : { mac, v4, v6, leasetime }:
|
||||
let v6s = concatStrings (map (a : ",[${a}]") v6);
|
||||
in "--dhcp-host=${mac},${v4}${v6s},${name},${builtins.toString leasetime}";
|
||||
hostOpt =
|
||||
name:
|
||||
{
|
||||
mac,
|
||||
v4,
|
||||
v6,
|
||||
leasetime,
|
||||
}:
|
||||
let
|
||||
v6s = concatStrings (map (a: ",[${a}]") v6);
|
||||
in
|
||||
"--dhcp-host=${mac},${v4}${v6s},${name},${builtins.toString leasetime}";
|
||||
in
|
||||
longrun {
|
||||
inherit name;
|
||||
@@ -35,7 +44,12 @@ longrun {
|
||||
${lib.concatStringsSep " " (builtins.map (r: "--server=${r}") upstreams)} \
|
||||
--keep-in-foreground \
|
||||
--dhcp-authoritative \
|
||||
${if resolvconf != null then "--resolv-file=$(output_path ${resolvconf} resolv.conf)" else "--no-resolv"} \
|
||||
${
|
||||
if resolvconf != null then
|
||||
"--resolv-file=$(output_path ${resolvconf} resolv.conf)"
|
||||
else
|
||||
"--no-resolv"
|
||||
} \
|
||||
${lib.concatStringsSep " " (mapAttrsToList hostOpt hosts)} \
|
||||
--no-hosts \
|
||||
--log-dhcp \
|
||||
@@ -44,7 +58,7 @@ longrun {
|
||||
--dhcp-leasefile=$(mkstate ${name})/leases \
|
||||
--pid-file=/run/${name}.pid
|
||||
'';
|
||||
# --log-debug \
|
||||
# --log-queries \
|
||||
# --log-debug \
|
||||
# --log-queries \
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user