Merge pull request #30339 from pvgoran/fileSystems-silentFormatOptions

filesystems: use non-interactive formatOptions by default
This commit is contained in:
Franz Pletz 2017-10-25 10:46:46 +02:00 committed by GitHub
commit 666d9c09c1

View File

@ -115,11 +115,18 @@ let
};
config = {
options = mkIf config.autoResize [ "x-nixos.autoresize" ];
config = let
defaultFormatOptions =
# -F needed to allow bare block device without partitions
formatOptions = mkIf ((builtins.substring 0 3 config.fsType) == "ext") (mkDefault "-F");
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" ];
formatOptions = mkIf (defaultFormatOptions != null) (mkDefault defaultFormatOptions);
};
};