Merge pull request #3940 from wkennington/master.dnsmasq
nixos/dnsmasq: Fix regressions during the systemd update
This commit is contained in:
commit
a82c623c26
@ -11,6 +11,9 @@ let
|
|||||||
conf-file=/etc/dnsmasq-conf.conf
|
conf-file=/etc/dnsmasq-conf.conf
|
||||||
resolv-file=/etc/dnsmasq-resolv.conf
|
resolv-file=/etc/dnsmasq-resolv.conf
|
||||||
''}
|
''}
|
||||||
|
${flip concatMapStrings cfg.servers (server: ''
|
||||||
|
server=${server}
|
||||||
|
'')}
|
||||||
${cfg.extraConfig}
|
${cfg.extraConfig}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@ -43,12 +46,10 @@ in
|
|||||||
default = [];
|
default = [];
|
||||||
example = [ "8.8.8.8" "8.8.4.4" ];
|
example = [ "8.8.8.8" "8.8.4.4" ];
|
||||||
description = ''
|
description = ''
|
||||||
The parameter to dnsmasq -S.
|
The dns servers which dnsmasq should query.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extraConfig = mkOption {
|
extraConfig = mkOption {
|
||||||
type = types.string;
|
type = types.string;
|
||||||
default = "";
|
default = "";
|
||||||
@ -67,8 +68,8 @@ in
|
|||||||
|
|
||||||
config = mkIf config.services.dnsmasq.enable {
|
config = mkIf config.services.dnsmasq.enable {
|
||||||
|
|
||||||
environment.systemPackages = [ dnsmasq ]
|
networking.nameservers =
|
||||||
++ (if cfg.resolveLocalQueries then [ pkgs.openresolv ] else []);
|
optional cfg.resolveLocalQueries "127.0.0.1";
|
||||||
|
|
||||||
services.dbus.packages = [ dnsmasq ];
|
services.dbus.packages = [ dnsmasq ];
|
||||||
|
|
||||||
@ -83,10 +84,14 @@ in
|
|||||||
description = "dnsmasq daemon";
|
description = "dnsmasq daemon";
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
path = [ dnsmasq ];
|
||||||
|
preStart = ''
|
||||||
|
touch /etc/dnsmasq-{conf,resolv}.conf
|
||||||
|
dnsmasq --test
|
||||||
|
'';
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "dbus";
|
Type = "dbus";
|
||||||
BusName = "uk.org.thekelleys.dnsmasq";
|
BusName = "uk.org.thekelleys.dnsmasq";
|
||||||
ExecStartPre = "${dnsmasq}/bin/dnsmasq --test";
|
|
||||||
ExecStart = "${dnsmasq}/bin/dnsmasq -k --enable-dbus --user=dnsmasq -C ${dnsmasqConf}";
|
ExecStart = "${dnsmasq}/bin/dnsmasq -k --enable-dbus --user=dnsmasq -C ${dnsmasqConf}";
|
||||||
ExecReload = "${dnsmasq}/bin/kill -HUP $MAINPID";
|
ExecReload = "${dnsmasq}/bin/kill -HUP $MAINPID";
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user