From bd75d14b0f1dfd244dadd0ffb1992d9af804dc71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Niemier?= Date: Thu, 28 Jan 2021 13:59:11 +0100 Subject: [PATCH] fix: use separate config option to set port of DNSmasq Older approach seems to not work on macOS 11 Big Sur for some reason. --- modules/services/dnsmasq.nix | 5 ++++- tests/services-dnsmasq.nix | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/services/dnsmasq.nix b/modules/services/dnsmasq.nix index 9a8cf11a..99486f13 100644 --- a/modules/services/dnsmasq.nix +++ b/modules/services/dnsmasq.nix @@ -63,7 +63,10 @@ in name = "resolver/${domain}"; value = { enable = true; - text = "nameserver ${cfg.bind}.${toString cfg.port}"; + text = '' + port ${toString cfg.port} + nameserver ${cfg.bind} + ''; }; }) (builtins.attrNames cfg.addresses)); }; diff --git a/tests/services-dnsmasq.nix b/tests/services-dnsmasq.nix index 9227e3ed..6bab02f5 100644 --- a/tests/services-dnsmasq.nix +++ b/tests/services-dnsmasq.nix @@ -20,6 +20,7 @@ in grep -F -- "--address=/localhost/127.0.0.1" ${config.out}/Library/LaunchDaemons/org.nixos.dnsmasq.plist echo >&2 "checking resolver config" - grep -F "nameserver 127.0.0.1.53" ${config.out}/etc/resolver/localhost + grep -F "port 53" ${config.out}/etc/resolver/localhost + grep -F "nameserver 127.0.0.1" ${config.out}/etc/resolver/localhost ''; }