mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 21:33:03 +03:00
filesystems: use non-interactive formatOptions by default
When autoFormat is enabled, in order to successfully create a filesystem, certain filesystems require specific options to be passed to mkfs to prevent it from asking questions. This commit sets default formatOptions to "-q" for "jfs" and "reiserfs" filesystems for this purpose. Resolves #29140.
This commit is contained in:
parent
056c764e84
commit
e3f97e514d
@ -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);
|
||||
};
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user