forked from mirrors/nixpkgs
6bd4e0b8cd
This shuts up this error from dbus:
May 11 13:52:16 machine dbus-daemon[259]: Unknown username "systemd-network" in message bus configuration file
May 11 13:52:16 machine dbus-daemon[259]: Unknown username "systemd-resolve" in message bus configuration file
which happens because the D-Bus config for networkd/resolved is
enabled unconditionally, and we don't have an easy way to turn it off.
(cherry picked from commit f19b58fb6a
)
36 lines
708 B
Nix
36 lines
708 B
Nix
{ 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 {
|
|
|
|
systemd.additionalUpstreamSystemUnits = [ "systemd-resolved.service" ];
|
|
|
|
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}
|
|
'';
|
|
|
|
};
|
|
|
|
}
|