diff options
author | lewo <lewo@abesis.fr> | 2019-03-22 14:35:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-22 14:35:57 +0100 |
commit | c8a65c2d717c8b1e0c83ae38c7796847221d464d (patch) | |
tree | df027b71172640d1f0d7c62cb2a9f38d4f94675e /nixos | |
parent | 11d204a9c4fa5b562b2588af9326d1ee2319481c (diff) | |
parent | 0eb6d0735f599fa84e99b727c93681bcae96c845 (diff) | |
download | nixlib-c8a65c2d717c8b1e0c83ae38c7796847221d464d.tar nixlib-c8a65c2d717c8b1e0c83ae38c7796847221d464d.tar.gz nixlib-c8a65c2d717c8b1e0c83ae38c7796847221d464d.tar.bz2 nixlib-c8a65c2d717c8b1e0c83ae38c7796847221d464d.tar.lz nixlib-c8a65c2d717c8b1e0c83ae38c7796847221d464d.tar.xz nixlib-c8a65c2d717c8b1e0c83ae38c7796847221d464d.tar.zst nixlib-c8a65c2d717c8b1e0c83ae38c7796847221d464d.zip |
Merge pull request #57751 from talyz/master
filesystems: Add autoResize assertion
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/tasks/filesystems.nix | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix index 07f8214cea2c..43764bb82f1f 100644 --- a/nixos/modules/tasks/filesystems.nix +++ b/nixos/modules/tasks/filesystems.nix @@ -209,10 +209,17 @@ in assertions = let ls = sep: concatMapStringsSep sep (x: x.mountPoint); + notAutoResizable = fs: fs.autoResize && !(hasPrefix "ext" fs.fsType || fs.fsType == "f2fs"); in [ { assertion = ! (fileSystems' ? "cycle"); 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 |