2015-04-19 19:05:12 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
services.resolved.enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
type = types.bool;
|
|
|
|
description = ''
|
|
|
|
Whether to enable the systemd DNS resolver daemon.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf config.services.resolved.enable {
|
|
|
|
|
2015-04-19 19:11:14 +00:00
|
|
|
systemd.additionalUpstreamSystemUnits = [ "systemd-resolved.service" ];
|
|
|
|
|
2015-04-19 19:05:12 +00:00
|
|
|
systemd.services.systemd-resolved = {
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
restartTriggers = [ config.environment.etc."systemd/resolved.conf".source ];
|
|
|
|
};
|
|
|
|
|
|
|
|
environment.etc."systemd/resolved.conf".text = ''
|
|
|
|
[Resolve]
|
|
|
|
DNS=${concatStringsSep " " config.networking.nameservers}
|
|
|
|
'';
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|