nixos/dnsmasq: add config option to retrive config file path

Changed files
+12 -6
nixos
modules
services
networking
+12 -6
nixos/modules/services/networking/dnsmasq.nix
···
configFile = lib.mkOption {
type = lib.types.package;
-
default = dnsmasqConf;
-
internal = true;
+
readOnly = true;
+
description = ''
+
Path to the configuration file of dnsmasq.
+
'';
};
};
···
config = lib.mkIf cfg.enable {
-
services.dnsmasq.settings = {
-
dhcp-leasefile = lib.mkDefault "${stateDir}/dnsmasq.leases";
-
conf-file = lib.mkDefault (lib.optional cfg.resolveLocalQueries "/etc/dnsmasq-conf.conf");
-
resolv-file = lib.mkDefault (lib.optional cfg.resolveLocalQueries "/etc/dnsmasq-resolv.conf");
+
services.dnsmasq = {
+
settings = {
+
dhcp-leasefile = lib.mkDefault "${stateDir}/dnsmasq.leases";
+
conf-file = lib.mkDefault (lib.optional cfg.resolveLocalQueries "/etc/dnsmasq-conf.conf");
+
resolv-file = lib.mkDefault (lib.optional cfg.resolveLocalQueries "/etc/dnsmasq-resolv.conf");
+
};
+
+
configFile = dnsmasqConf;
};
networking.nameservers = lib.optional cfg.resolveLocalQueries "127.0.0.1";