about summary refs log tree commit diff
path: root/nixos/modules/tasks
diff options
context:
space:
mode:
authorFranz Pletz <fpletz@fnordicwalking.de>2017-10-25 10:46:46 +0200
committerGitHub <noreply@github.com>2017-10-25 10:46:46 +0200
commit666d9c09c1880c41a88426a3436b510ea1c8c272 (patch)
tree251619090e4969b9b0589f126913cfdbb6a0851d /nixos/modules/tasks
parenta86207bc21fab114a878d617f58360110ad099e5 (diff)
parente3f97e514d2c293145c99a2438bf31754dcccc06 (diff)
downloadnixlib-666d9c09c1880c41a88426a3436b510ea1c8c272.tar
nixlib-666d9c09c1880c41a88426a3436b510ea1c8c272.tar.gz
nixlib-666d9c09c1880c41a88426a3436b510ea1c8c272.tar.bz2
nixlib-666d9c09c1880c41a88426a3436b510ea1c8c272.tar.lz
nixlib-666d9c09c1880c41a88426a3436b510ea1c8c272.tar.xz
nixlib-666d9c09c1880c41a88426a3436b510ea1c8c272.tar.zst
nixlib-666d9c09c1880c41a88426a3436b510ea1c8c272.zip
Merge pull request #30339 from pvgoran/fileSystems-silentFormatOptions
filesystems: use non-interactive formatOptions by default
Diffstat (limited to 'nixos/modules/tasks')
-rw-r--r--nixos/modules/tasks/filesystems.nix15
1 files changed, 11 insertions, 4 deletions
diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix
index 6ceb36714b28..b3690fad1a6a 100644
--- a/nixos/modules/tasks/filesystems.nix
+++ b/nixos/modules/tasks/filesystems.nix
@@ -115,11 +115,18 @@ let
 
     };
 
-    config = {
+    config = let
+      defaultFormatOptions =
+        # -F needed to allow bare block device without partitions
+        if (builtins.substring 0 3 config.fsType) == "ext" then "-F"
+        # -q needed for non-interactive operations
+        else if config.fsType == "jfs" then "-q"
+        # (same here)
+        else if config.fsType == "reiserfs" then "-q"
+        else null;
+    in {
       options = mkIf config.autoResize [ "x-nixos.autoresize" ];
-
-      # -F needed to allow bare block device without partitions
-      formatOptions = mkIf ((builtins.substring 0 3 config.fsType) == "ext") (mkDefault "-F");
+      formatOptions = mkIf (defaultFormatOptions != null) (mkDefault defaultFormatOptions);
     };
 
   };