diff --git a/hosts/common/configs/system/dnsmasq/default.nix b/hosts/common/configs/system/dnsmasq/default.nix index 3dbd649..d43c5e0 100644 --- a/hosts/common/configs/system/dnsmasq/default.nix +++ b/hosts/common/configs/system/dnsmasq/default.nix @@ -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" ]; + }; } diff --git a/hosts/common/configs/system/libvirt/default.nix b/hosts/common/configs/system/libvirt/default.nix index da1afae..aeb260b 100644 --- a/hosts/common/configs/system/libvirt/default.nix +++ b/hosts/common/configs/system/libvirt/default.nix @@ -18,7 +18,7 @@ }; systemd.services = { - libvirtd.after = lib.mkIf config.services.dnsmasq.enable [ "dnsmasq.service" ]; + libvirtd.after = [ "NetworkManager.service" ]; libvirtd-network-default = { description = "Start Default Virtual Network for Libvirt"; diff --git a/hosts/elara/configs/dnsmasq/default.nix b/hosts/elara/configs/dnsmasq/default.nix deleted file mode 100644 index 01c65d1..0000000 --- a/hosts/elara/configs/dnsmasq/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... }: -{ - specialisation.sas.configuration.services.dnsmasq.settings.server = [ - "1.1.1.1" - "1.0.0.1" - # SAS Guest DNS - "208.67.220.220" - "208.67.222.222" - ]; -} diff --git a/hosts/elara/default.nix b/hosts/elara/default.nix index b03d8bf..a517bd1 100644 --- a/hosts/elara/default.nix +++ b/hosts/elara/default.nix @@ -47,7 +47,6 @@ ../common/configs/system/users ../common/configs/system/zsh - ./configs/dnsmasq ./configs/git ./configs/vpn