Fixed (hopefully) freezes of entire system because of suspend
Thanks Systemd
This commit is contained in:
parent
ecdfd3fac4
commit
a0fcd515e1
2 changed files with 17 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
14
modules/nixos/presets/default/unfreeze-systemd.nix
Normal file
14
modules/nixos/presets/default/unfreeze-systemd.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue