Don't include networkd units unless enabled
Otherwise, the enabled -> disabled transition won't be handled correctly (switch-to-configuration currently assumes that if a unit is running and exists, it should be restarted).
This commit is contained in:
parent
f8dbe5f376
commit
c87977e97d
|
@ -624,6 +624,9 @@ in
|
|||
|
||||
config = mkIf config.systemd.network.enable {
|
||||
|
||||
systemd.additionalUpstreamSystemUnits =
|
||||
[ "systemd-networkd.service" "systemd-networkd-wait-online.service" ];
|
||||
|
||||
systemd.network.units =
|
||||
mapAttrs' (n: v: nameValuePair "${n}.link" (linkToUnit n v)) cfg.links
|
||||
// mapAttrs' (n: v: nameValuePair "${n}.netdev" (netdevToUnit n v)) cfg.netdevs
|
||||
|
|
|
@ -18,6 +18,8 @@ with lib;
|
|||
|
||||
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 ];
|
||||
|
|
|
@ -97,12 +97,6 @@ let
|
|||
"systemd-modules-load.service"
|
||||
"kmod-static-nodes.service"
|
||||
|
||||
# Networking
|
||||
"systemd-networkd.service"
|
||||
"systemd-networkd-wait-online.service"
|
||||
"systemd-resolved.service"
|
||||
"systemd-timesyncd.service"
|
||||
|
||||
# Filesystems.
|
||||
"systemd-fsck@.service"
|
||||
"systemd-fsck-root.service"
|
||||
|
|
|
@ -18,6 +18,8 @@ with lib;
|
|||
|
||||
config = mkIf config.services.timesyncd.enable {
|
||||
|
||||
systemd.additionalUpstreamSystemUnits = [ "systemd-timesyncd.service" ];
|
||||
|
||||
systemd.services.systemd-timesyncd = {
|
||||
wantedBy = [ "sysinit.target" ];
|
||||
restartTriggers = [ config.environment.etc."systemd/timesyncd.conf".source ];
|
||||
|
|
Loading…
Reference in New Issue