From 573ab0102e856121085732d9186af9cd510aaeae Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 25 May 2021 17:19:04 +0800 Subject: [PATCH] nixops: disable suspend more aggressively --- nixops/desktop.nix | 14 ++++++++++++-- nixops/light.nix | 12 ++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/nixops/desktop.nix b/nixops/desktop.nix index cfb5a95..e59eeb0 100644 --- a/nixops/desktop.nix +++ b/nixops/desktop.nix @@ -117,11 +117,21 @@ in services.xserver.xkbOptions = "eurosign:e"; services.xserver.displayManager.gdm.enable = true; - services.xserver.displayManager.gdm.autoSuspend = false; - powerManagement.enable = false; services.xserver.desktopManager.gnome3.enable = true; environment.gnome3.excludePackages = [ pkgs.epiphany pkgs.gnome3.geary ]; + systemd.suppressedSystemUnits = [ + "hibernate.target" + "suspend.target" + "suspend-then-hibernate.target" + "sleep.target" + "hybrid-sleep.target" + "systemd-hibernate.service" + "systemd-hybrid-sleep.service" + "systemd-suspend.service" + "systemd-suspend-then-hibernate.service" + ]; + hardware.bluetooth.enable = true; programs.fish.enable = true; diff --git a/nixops/light.nix b/nixops/light.nix index 223bba8..2c55f0c 100644 --- a/nixops/light.nix +++ b/nixops/light.nix @@ -104,6 +104,18 @@ in services.xserver.displayManager.lightdm.enable = true; services.xserver.desktopManager.xfce.enable = true; + systemd.suppressedSystemUnits = [ + "hibernate.target" + "suspend.target" + "suspend-then-hibernate.target" + "sleep.target" + "hybrid-sleep.target" + "systemd-hibernate.service" + "systemd-hybrid-sleep.service" + "systemd-suspend.service" + "systemd-suspend-then-hibernate.service" + ]; + programs.fish.enable = true; programs.fish.promptInit = '' any-nix-shell fish --info-right | source