lol

Merge pull request #171680 from bryanasdev000/zfshibernation

nixos/zfs: introduce option to control hibernation

authored by

Thiago Kenji Okada and committed by
GitHub
f83198ab 60b1608a

+27
+12
nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
··· 876 876 </listitem> 877 877 <listitem> 878 878 <para> 879 + ZFS module will not allow hibernation by default, this is a 880 + safety measure to prevent data loss cases like the ones 881 + described at 882 + <link xlink:href="https://github.com/openzfs/zfs/issues/260">OpenZFS/260</link> 883 + and 884 + <link xlink:href="https://github.com/openzfs/zfs/issues/12842">OpenZFS/12842</link>. 885 + Use the <literal>boot.zfs.allowHibernation</literal> option to 886 + configure this behaviour. 887 + </para> 888 + </listitem> 889 + <listitem> 890 + <para> 879 891 The Redis module now disables RDB persistence when 880 892 <literal>services.redis.servers.&lt;name&gt;.save = []</literal> 881 893 instead of using the Redis default.
+2
nixos/doc/manual/release-notes/rl-2211.section.md
··· 273 273 274 274 - A new module was added for the Saleae Logic device family, providing the options `hardware.saleae-logic.enable` and `hardware.saleae-logic.package`. 275 275 276 + - 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. 277 + 276 278 - The Redis module now disables RDB persistence when `services.redis.servers.<name>.save = []` instead of using the Redis default. 277 279 278 280 - 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
··· 226 226 ''; 227 227 }; 228 228 229 + allowHibernation = mkOption { 230 + type = types.bool; 231 + default = false; 232 + description = lib.mdDoc '' 233 + Allow hibernation support, this may be a unsafe option depending on your 234 + setup. Make sure to NOT use Swap on ZFS. 235 + ''; 236 + }; 237 + 229 238 extraPools = mkOption { 230 239 type = types.listOf types.str; 231 240 default = []; ··· 498 507 499 508 boot = { 500 509 kernelModules = [ "zfs" ]; 510 + # https://github.com/openzfs/zfs/issues/260 511 + # https://github.com/openzfs/zfs/issues/12842 512 + # https://github.com/NixOS/nixpkgs/issues/106093 513 + kernelParams = lib.optionals (!config.boot.zfs.allowHibernation) [ "nohibernate" ]; 501 514 502 515 extraModulePackages = [ 503 516 (if config.boot.zfs.enableUnstable then