Recently, I re-installed NixOS with my config and noticed that for some reason, when I hibernate my PC, the screen no longer locks beforehand. Other than that, hibernating works fine and as expected.
Before this, I made some pretty significant changes that I think may be related, namely:
I use NixOS unstable with an impermanent setup, I use hypridle
as my idle daemon, I use wlogout
to hibernate, and I use a custom-written script to lock my screen.
Running systemctl hibernate
manually does not appear to make any difference and I can still directly lock my screen.
Here is my dotfile repo: GitHub - Anomalocaridid/dotfiles: My personal dotfiles for NixOS
I’m not sure if this is your issue, but you do have a pretty critical problem that should be basically destroying your system, IIUC. You’re wiping your file system in postDeviceCommands
, which happens before the system attempts to resume. So you’re making permanent changes to the disk, and then attempting to resume from a swap image that expects your disk to be in its old state.
I’m amazed your complaint isn’t “my system has completely exploded”. You want to be doing the disk wiping thing in boot.initrd.postResumeCommands
.
1 Like
Yikes! Thanks a lot for bringing this to my attention!
Just to be safe, I think I’ll switch back to my previous approach of using a tmpfs because that seemed to be working well for me.
Update: I have hopefully defused my system by switching back to using a tmpfs.
Unfortunately, the screen still does not lock when hibernating for whatever reason.
It slipped my mind before, but just in case, I should also probably mention that I also recently changed my disko configuration to use the gpt
type rather than the deprecated table
type.
What I would consider doing is try to discover what nixpkgs commit introduced the issue. Could be a lengthy process.
1 Like