diff options
author | Bryan A. S <bryanasdev000@gmail.com> | 2022-05-05 11:42:44 -0300 |
---|---|---|
committer | Bryan A. S <bryanasdev000@gmail.com> | 2022-10-29 04:46:27 -0300 |
commit | a53858010b576291eda47035fbaa77ab40bf33c7 (patch) | |
tree | f7144969496bd6056a1f7cfd7457c9a5c39fc353 /nixos/modules/tasks/filesystems | |
parent | 956e35d0b10cd48df91e1b4e2c928efe178335ed (diff) |
nixos/zfs: introduce option to control hibernation
Diffstat (limited to 'nixos/modules/tasks/filesystems')
-rw-r--r-- | nixos/modules/tasks/filesystems/zfs.nix | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix index 96222f3b4f645..4b4f4cc801aba 100644 --- a/nixos/modules/tasks/filesystems/zfs.nix +++ b/nixos/modules/tasks/filesystems/zfs.nix @@ -226,6 +226,15 @@ in ''; }; + allowHibernation = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc '' + Allow hibernation support, this may be a unsafe option depending on your + setup. Make sure to NOT use Swap on ZFS. + ''; + }; + extraPools = mkOption { type = types.listOf types.str; default = []; @@ -498,6 +507,10 @@ in boot = { kernelModules = [ "zfs" ]; + # https://github.com/openzfs/zfs/issues/260 + # https://github.com/openzfs/zfs/issues/12842 + # https://github.com/NixOS/nixpkgs/issues/106093 + kernelParams = lib.optionals (!config.boot.zfs.allowHibernation) [ "nohibernate" ]; extraModulePackages = [ (if config.boot.zfs.enableUnstable then |