From 4b939affaff56d426470bdb4938359426dca941b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Apr 2026 11:58:07 +0000 Subject: [PATCH 1/2] Initial plan From d6471aad55d48172acd73deca49d7d7f1874a6e8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Apr 2026 12:00:45 +0000 Subject: [PATCH 2/2] feat(core): add system-level no-sleep module Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/b0e72301-13fd-4c14-9b3b-584e8c04267f Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com> --- modules/core/no-sleep.nix | 35 +++++++++++++++++++++++++++++++++++ modules/modules.nix | 1 + 2 files changed, 36 insertions(+) create mode 100644 modules/core/no-sleep.nix diff --git a/modules/core/no-sleep.nix b/modules/core/no-sleep.nix new file mode 100644 index 0000000..a3c5447 --- /dev/null +++ b/modules/core/no-sleep.nix @@ -0,0 +1,35 @@ +# ── modules/core/no-sleep.nix ───────────────────────────────────────────────── +# Prevents the machine from ever sleeping or suspending at the system level. +# +# This operates at two layers below GNOME: +# 1. systemd-logind — ignores all hardware power events (lid, suspend key, etc.) +# 2. systemd targets — masks sleep/suspend/hibernate targets so nothing can +# trigger them, not even `systemctl suspend` or D-Bus calls. +# +# This is intentional for a 24/7 server/node. The GNOME-layer power settings in +# sovran_systemsos-desktop.nix remain in place as a belt-and-suspenders complement +# for active user sessions. +{ ... }: + +{ + # ── Layer 1: logind hardware event handling ──────────────────────────────── + services.logind = { + lidSwitch = "ignore"; + lidSwitchDocked = "ignore"; + lidSwitchExternalPower = "ignore"; + extraConfig = '' + HandleSuspendKey=ignore + HandleHibernateKey=ignore + HandlePowerKey=ignore + IdleAction=ignore + IdleActionSec=0 + ''; + }; + + # ── Layer 2: mask systemd sleep targets ─────────────────────────────────── + # Nothing on the system can suspend/hibernate — not root, not GNOME, not D-Bus. + systemd.targets.sleep.enable = false; + systemd.targets.suspend.enable = false; + systemd.targets.hibernate.enable = false; + systemd.targets.hybrid-sleep.enable = false; +} diff --git a/modules/modules.nix b/modules/modules.nix index e6d12dd..1323d87 100755 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -14,6 +14,7 @@ ./core/sovran-hub.nix ./core/legacy-cleanup.nix ./core/remote-deploy.nix + ./core/no-sleep.nix # ── Always on (no flag) ─────────────────────────────────── ./php.nix