nixos/zfs: introduce option to control hibernation

Changed files
+27
nixos
doc
manual
from_md
release-notes
release-notes
modules
tasks
filesystems
+12
nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
···
</listitem>
<listitem>
<para>
+
ZFS module will not allow hibernation by default, this is a
+
safety measure to prevent data loss cases like the ones
+
described at
+
<link xlink:href="https://github.com/openzfs/zfs/issues/260">OpenZFS/260</link>
+
and
+
<link xlink:href="https://github.com/openzfs/zfs/issues/12842">OpenZFS/12842</link>.
+
Use the <literal>boot.zfs.allowHibernation</literal> option to
+
configure this behaviour.
+
</para>
+
</listitem>
+
<listitem>
+
<para>
The Redis module now disables RDB persistence when
<literal>services.redis.servers.&lt;name&gt;.save = []</literal>
instead of using the Redis default.
+2
nixos/doc/manual/release-notes/rl-2211.section.md
···
- A new module was added for the Saleae Logic device family, providing the options `hardware.saleae-logic.enable` and `hardware.saleae-logic.package`.
+
- ZFS module will not allow hibernation by default, this is a safety measure to prevent data loss cases like the ones described at [OpenZFS/260](https://github.com/openzfs/zfs/issues/260) and [OpenZFS/12842](https://github.com/openzfs/zfs/issues/12842). Use the `boot.zfs.allowHibernation` option to configure this behaviour.
+
- The Redis module now disables RDB persistence when `services.redis.servers.<name>.save = []` instead of using the Redis default.
- Neo4j was updated from version 3 to version 4. See this [migration guide](https://neo4j.com/docs/upgrade-migration-guide/current/) on how to migrate your Neo4j instance.
+13
nixos/modules/tasks/filesystems/zfs.nix
···
'';
};
+
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 = [];
···
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