Enable Hibernation on NixOS

Posted on March 10, 2025 Tags: nix Hibernation was broken for me since a long time. I postponed trying to fix it for such a long time. Then, I stumbled onto this post which had the fix! To celebrate the finding, I’m sharing a NixOS module to enable hibernation. As a prerequisite, you need to create a swap partition, as noted in the NixOS wiki . As for the module, here it is: { config , pkgs , lib…