summary refs log tree commit diff
diff options
context:
space:
mode:
authorWilliam A. Kennington III <william@wkennington.com>2014-12-01 17:17:46 -0800
committerWilliam A. Kennington III <william@wkennington.com>2014-12-01 17:19:44 -0800
commit2b06a92c2a113f70b1c07a5be3e53a2f229f379b (patch)
tree25b04efecac699c436342d918ea9e8153998b7b8
parent1716c12b5410c26f7371a00be8c3f19ab6b6c907 (diff)
downloadnixlib-2b06a92c2a113f70b1c07a5be3e53a2f229f379b.tar
nixlib-2b06a92c2a113f70b1c07a5be3e53a2f229f379b.tar.gz
nixlib-2b06a92c2a113f70b1c07a5be3e53a2f229f379b.tar.bz2
nixlib-2b06a92c2a113f70b1c07a5be3e53a2f229f379b.tar.lz
nixlib-2b06a92c2a113f70b1c07a5be3e53a2f229f379b.tar.xz
nixlib-2b06a92c2a113f70b1c07a5be3e53a2f229f379b.tar.zst
nixlib-2b06a92c2a113f70b1c07a5be3e53a2f229f379b.zip
nixos/nfs: Fix dependency ordering
-rw-r--r--nixos/modules/system/boot/systemd.nix5
-rw-r--r--nixos/modules/tasks/filesystems/nfs.nix8
-rw-r--r--nixos/tests/nfs.nix2
3 files changed, 11 insertions, 4 deletions
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index 64667acf1277..80208c1525d5 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -947,6 +947,11 @@ in
 
     systemd.targets.network-online.after = [ "ip-up.target" ];
 
+    systemd.targets.remote-fs-pre = {
+      wantedBy = [ "remote-fs.target" ];
+      before = [ "remote-fs.target" ];
+    };
+
     systemd.units =
       mapAttrs' (n: v: nameValuePair "${n}.target" (targetToUnit n v)) cfg.targets
       // mapAttrs' (n: v: nameValuePair "${n}.service" (serviceToUnit n v)) cfg.services
diff --git a/nixos/modules/tasks/filesystems/nfs.nix b/nixos/modules/tasks/filesystems/nfs.nix
index 45c1119215e5..546145e54ac7 100644
--- a/nixos/modules/tasks/filesystems/nfs.nix
+++ b/nixos/modules/tasks/filesystems/nfs.nix
@@ -73,9 +73,10 @@ in
 
         path = [ pkgs.nfsUtils pkgs.sysvtools pkgs.utillinux ];
 
-        wantedBy = [ "multi-user.target" ];
+        wantedBy = [ "remote-fs-pre.target" ];
+        before = [ "remote-fs-pre.target" ];
         requires = [ "basic.target" "rpcbind.service" ];
-        after = [ "basic.target" "rpcbind.service" "network.target" ];
+        after = [ "basic.target" "rpcbind.service" ];
 
         unitConfig.DefaultDependencies = false; # don't stop during shutdown
 
@@ -99,7 +100,8 @@ in
 
         path = [ pkgs.sysvtools pkgs.utillinux ];
 
-        wantedBy = [ "multi-user.target" ];
+        wantedBy = [ "remote-fs-pre.target" ];
+        before = [ "remote-fs-pre.target" ];
         requires = [ "rpcbind.service" ];
         after = [ "rpcbind.service" ];
 
diff --git a/nixos/tests/nfs.nix b/nixos/tests/nfs.nix
index 61b2431c04c7..3a6ea7701c4e 100644
--- a/nixos/tests/nfs.nix
+++ b/nixos/tests/nfs.nix
@@ -38,7 +38,7 @@ in
   testScript =
     ''
       $server->waitForUnit("nfsd");
-      $server->waitForUnit("network.target");
+      $server->waitForUnit("network-online.target");
 
       startAll;