Hi, I’m using Nixos on my laptop on unstable with kde and swap partition. When I try putting it to sleep, it essentially restart: booting into grub menu, asking for password to decrypt, and does not remember any applications I have opened.
It’s even worst for hibernation because it disable my wifi, and I need to shutdown and restart to enable it again, simple restart doesn’t work.
Here’s some info about my setup:
- Kernel: Linux 6.15.1
- OS: NixOS 25.11
- Wifi card: Realtek, driver: rtw89_8852ce
I’m just wondering how I can get sleep/hibernate to work similar to a macbook
For ref: GitHub - vietNGit/flake_setup
I’m having similar issues. If I put my computer to sleep, I can’t wake it back up. I have to power it off then power it back on again.
Things I’ve tried:
- Importing the correct nixos-hardware (though I have this problem on all of my nixos machines, so at least for me, the problem is bigger than that)
- Looking at logs (I’m still learning how to understand them, or which logs are even relevent.)
Importing the right nixos-hardware might fix it for you, but it hasn’t for me.
For ref: https://github.com/Voidlighter/NixConfig
1 Like
You can always run nixos-generate-config
. It will scan your hardware and generate proper hardware-configuration.nix. But be aware that it will overwrite your hardware-configuration.nix, so backup it before. It shouldn’t overwrite configuration.nix but to be safe backup it also.
1 Like
Try these options:
Option for suspend and hibernation:
https://wiki.nixos.org/wiki/Laptop#Power_management
Options for hibernation:
1 Like
Hi all, thank you for your inputs, I really appreciate it
.
@Voidlighter I don’t think its because of importing the wrong hardware config, since I only have my laptop host setup.
@kazimierzkrauze I’ll try running the command and see if there’re any differences between the 2, but I don’t think there’d be any, cause I don’t modify the hardware config file in the first place.
@phaeseeKe5Ee Thanks for the link
. I skimmed through and it said encrypted swap devices or swap files are not yet supported for hibernation
, maybe this is why it didn’t work for me, I do set up encryption. I’ll try to reinstall a new version without encryption and see if it works.
Again, thank you for your help 
Sleep should be working with an encrypted swap.
At least it does on my notebook.
1 Like
Hi, thank you for your input 
Does it keep every applications you open? It basically restarts on mine
Yeah just like you would expect from sleep.
1 Like
So reinstalling it without encryption makes sleep and hibernate work, desktop session are saved and all that. But with hibernation it still disable my wifi on wake and i cant seem to re-enable it without shutting down and turn on my laptop a gain 