about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorwmertens <Wout.Mertens@gmail.com>2015-01-22 12:09:22 +0100
committerwmertens <Wout.Mertens@gmail.com>2015-01-22 12:09:22 +0100
commit8780caadd46e25c92330b61aa586951909b04211 (patch)
tree7dc0bcbcea23f4293ac70604e32facf5038325ad /nixos
parent001befaa6fb54b780254e7a7a6a5fc38051ccda0 (diff)
parent1b6607720539e42c9cc497bebafccc900674da63 (diff)
downloadnixlib-8780caadd46e25c92330b61aa586951909b04211.tar
nixlib-8780caadd46e25c92330b61aa586951909b04211.tar.gz
nixlib-8780caadd46e25c92330b61aa586951909b04211.tar.bz2
nixlib-8780caadd46e25c92330b61aa586951909b04211.tar.lz
nixlib-8780caadd46e25c92330b61aa586951909b04211.tar.xz
nixlib-8780caadd46e25c92330b61aa586951909b04211.tar.zst
nixlib-8780caadd46e25c92330b61aa586951909b04211.zip
Merge pull request #5499 from wizeman/u/zfs-dont-fsck
nixos: When generating /etc/fstab, ZFS and NFS filesystems shouldn't be checked
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/tasks/filesystems.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix
index 64a20034f3cc..c6f2f072352e 100644
--- a/nixos/modules/tasks/filesystems.nix
+++ b/nixos/modules/tasks/filesystems.nix
@@ -142,7 +142,10 @@ in
       ++ config.system.fsPackages;
 
     environment.etc.fstab.text =
-      ''
+      let
+        fsToSkipCheck = [ "none" "btrfs" "zfs" "tmpfs" "nfs" ];
+        skipCheck = fs: fs.noCheck || fs.device == "none" || builtins.elem fs.fsType fsToSkipCheck;
+      in ''
         # This is a generated file.  Do not edit!
 
         # Filesystems.
@@ -154,7 +157,7 @@ in
             + " " + fs.fsType
             + " " + fs.options
             + " 0"
-            + " " + (if fs.fsType == "none" || fs.device == "none" || fs.fsType == "btrfs" || fs.fsType == "tmpfs" || fs.noCheck then "0" else
+            + " " + (if skipCheck fs then "0" else
                      if fs.mountPoint == "/" then "1" else "2")
             + "\n"
         )}