about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorRyan Lahfa <masterancpp@gmail.com>2022-12-22 01:12:38 +0100
committerGitHub <noreply@github.com>2022-12-22 01:12:38 +0100
commita10069fd242f411c729b1885722dedbc9d46e21b (patch)
tree88017923739ad40a4ef8ab02e4b32c5bbe0cafec /nixos
parent5431f7ccb28faabd449df573b781c4dd46fe767b (diff)
parentc70f0473153c63ad1cf6fbea19f290db6b15291f (diff)
downloadnixlib-a10069fd242f411c729b1885722dedbc9d46e21b.tar
nixlib-a10069fd242f411c729b1885722dedbc9d46e21b.tar.gz
nixlib-a10069fd242f411c729b1885722dedbc9d46e21b.tar.bz2
nixlib-a10069fd242f411c729b1885722dedbc9d46e21b.tar.lz
nixlib-a10069fd242f411c729b1885722dedbc9d46e21b.tar.xz
nixlib-a10069fd242f411c729b1885722dedbc9d46e21b.tar.zst
nixlib-a10069fd242f411c729b1885722dedbc9d46e21b.zip
Merge pull request #203524 from jakubgs/zfs/no-force-import-hibernate
nixos/zfs: assert no force import with hibernation
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/tasks/filesystems/zfs.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix
index 4b4f4cc801ab..0f14f2b501c2 100644
--- a/nixos/modules/tasks/filesystems/zfs.nix
+++ b/nixos/modules/tasks/filesystems/zfs.nix
@@ -503,6 +503,10 @@ in
           assertion = !cfgZfs.forceImportAll || cfgZfs.forceImportRoot;
           message = "If you enable boot.zfs.forceImportAll, you must also enable boot.zfs.forceImportRoot";
         }
+        {
+          assertion = cfgZfs.allowHibernation -> !cfgZfs.forceImportRoot && !cfgZfs.forceImportAll;
+          message = "boot.zfs.allowHibernation while force importing is enabled will cause data corruption";
+        }
       ];
 
       boot = {