From c87977e97d97b8036caafb3a7e855c246712d739 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 19 Apr 2015 21:11:14 +0200 Subject: 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). --- nixos/modules/system/boot/networkd.nix | 3 +++ nixos/modules/system/boot/resolved.nix | 2 ++ nixos/modules/system/boot/systemd.nix | 6 ------ nixos/modules/system/boot/timesyncd.nix | 2 ++ 4 files changed, 7 insertions(+), 6 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix index 34a8b3fe0f95..21ee33a691a0 100644 --- a/nixos/modules/system/boot/networkd.nix +++ b/nixos/modules/system/boot/networkd.nix @@ -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 diff --git a/nixos/modules/system/boot/resolved.nix b/nixos/modules/system/boot/resolved.nix index cdc76d59f9a8..ecd547322d3c 100644 --- a/nixos/modules/system/boot/resolved.nix +++ b/nixos/modules/system/boot/resolved.nix @@ -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 ]; diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 4bd412014a54..12de5c9b16fb 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -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" diff --git a/nixos/modules/system/boot/timesyncd.nix b/nixos/modules/system/boot/timesyncd.nix index fd4be47ad721..cba965b1cd2b 100644 --- a/nixos/modules/system/boot/timesyncd.nix +++ b/nixos/modules/system/boot/timesyncd.nix @@ -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 ]; -- cgit 1.4.1