Fix dnsmasq

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-03-11 12:36:25 +00:00
parent 9c22042983
commit e4ff6f13b1
4 changed files with 20 additions and 30 deletions

View File

@@ -1,21 +1,22 @@
{ ... }:
{ lib, pkgs, ... }:
{
services.dnsmasq = {
enable = true;
settings = {
bind-interfaces = true;
listen-address = [ "127.0.0.1" ];
conf-dir = "/etc/dnsmasq.d,*.conf";
server = [
"1.1.1.1"
"1.0.0.1"
];
};
};
systemd.tmpfiles.rules = [ "d /etc/dnsmasq.d 0755 root resolvconf" ];
networking.networkmanager.dns = "dnsmasq";
environment.etc."NetworkManager/dnsmasq.d/10-bind-interfaces.conf".source =
(pkgs.formats.keyValue {
mkKeyValue =
name: value:
if value == true then
name
else if value == false then
""
else
lib.generators.mkKeyValueDefault { } "=" name value;
listsAsDuplicateKeys = true;
}).generate
"10-bind-interfaces.conf"
{
bind-interfaces = true;
listen-address = [ "127.0.0.1" ];
};
}