summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-04-19 21:11:14 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-04-19 22:06:45 +0200
commitc87977e97d97b8036caafb3a7e855c246712d739 (patch)
treee9954b3f6f34422bc2e787b4d792379066beb058 /nixos
parentf8dbe5f376978947067283c6d03087d7948c50de (diff)
downloadnixlib-c87977e97d97b8036caafb3a7e855c246712d739.tar
nixlib-c87977e97d97b8036caafb3a7e855c246712d739.tar.gz
nixlib-c87977e97d97b8036caafb3a7e855c246712d739.tar.bz2
nixlib-c87977e97d97b8036caafb3a7e855c246712d739.tar.lz
nixlib-c87977e97d97b8036caafb3a7e855c246712d739.tar.xz
nixlib-c87977e97d97b8036caafb3a7e855c246712d739.tar.zst
nixlib-c87977e97d97b8036caafb3a7e855c246712d739.zip
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).
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/boot/networkd.nix3
-rw-r--r--nixos/modules/system/boot/resolved.nix2
-rw-r--r--nixos/modules/system/boot/systemd.nix6
-rw-r--r--nixos/modules/system/boot/timesyncd.nix2
4 files changed, 7 insertions, 6 deletions
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 ];