Merge pull request #57751 from talyz/master
filesystems: Add autoResize assertion
This commit is contained in:
commit
c8a65c2d71
@ -209,10 +209,17 @@ in
|
|||||||
|
|
||||||
assertions = let
|
assertions = let
|
||||||
ls = sep: concatMapStringsSep sep (x: x.mountPoint);
|
ls = sep: concatMapStringsSep sep (x: x.mountPoint);
|
||||||
|
notAutoResizable = fs: fs.autoResize && !(hasPrefix "ext" fs.fsType || fs.fsType == "f2fs");
|
||||||
in [
|
in [
|
||||||
{ assertion = ! (fileSystems' ? "cycle");
|
{ assertion = ! (fileSystems' ? "cycle");
|
||||||
message = "The ‘fileSystems’ option can't be topologically sorted: mountpoint dependency path ${ls " -> " fileSystems'.cycle} loops to ${ls ", " fileSystems'.loops}";
|
message = "The ‘fileSystems’ option can't be topologically sorted: mountpoint dependency path ${ls " -> " fileSystems'.cycle} loops to ${ls ", " fileSystems'.loops}";
|
||||||
}
|
}
|
||||||
|
{ assertion = ! (any notAutoResizable fileSystems);
|
||||||
|
message = let
|
||||||
|
fs = head (filter notAutoResizable fileSystems);
|
||||||
|
in
|
||||||
|
"Mountpoint '${fs.mountPoint}': 'autoResize = true' is not supported for 'fsType = \"${fs.fsType}\"':${if fs.fsType == "auto" then " fsType has to be explicitly set and" else ""} only the ext filesystems and f2fs support it.";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
# Export for use in other modules
|
# Export for use in other modules
|
||||||
|
Loading…
x
Reference in New Issue
Block a user