Fixed (hopefully) freezes of entire system because of suspend

Thanks Systemd
This commit is contained in:
Aleksandr Lebedev 2025-10-29 09:11:22 +01:00
parent ecdfd3fac4
commit a0fcd515e1
2 changed files with 17 additions and 1 deletions

View file

@ -12,7 +12,9 @@ in {
options.${namespace}.presets.default = with types; {
enable = mkBoolOpt false "Enable preset with all the default settings - locale, time, etc";
};
imports = [
./systemd-unfreeze.nix
];
config = mkIf cfg.enable {
zramSwap = {
enable = true; # Hopefully? helps with freezing when using swap

View file

@ -0,0 +1,14 @@
# https://t.me/s/tazlog/65
# https://cl.tvl.fyi/c/depot/+/12961
# Workaround for disabling semi-broken systemd user slice freezing (whatever
# that is). This can cause machines to become unusable after resume.
let
override.environment.SYSTEMD_SLEEP_FREEZE_USER_SESSIONS = "false";
in {
systemd.services = {
systemd-suspend = override;
systemd-hibernate = override;
systemd-hybrid-sleep = override;
systemd-suspend-then-hibernate = override;
};
}