Genix rebuilds + hyprland version fix
This commit is contained in:
1 parent
cd7c908fde
commit
fd733cdc21
44 files changed
+363
-161
No files matched your search
@@ -113,6 +113,7 @@ in
|
||||
immich-ml = { ip = "10.0.101.11"; };
|
||||
gilix = { ip = "10.0.101.13"; };
|
||||
sibli = { ip = "10.0.101.14"; };
|
||||
genix = { ip = "10.0.101.12"; };
|
||||
jellyfin = { ip = "10.0.101.5"; };
|
||||
nvr = { ip = "10.0.101.6"; };
|
||||
portainer = { ip = "10.0.101.241"; };
|
||||
|
||||
@@ -136,11 +136,63 @@ let
|
||||
print("Lid event monitor stopped", file=sys.stderr, flush=True)
|
||||
EOFPYTHON
|
||||
'';
|
||||
|
||||
# Safety net: if the lid is closed but the machine is still awake, force a
|
||||
# suspend. Runs every minute via lid-suspend-watchdog.timer. Rescues the
|
||||
# "closed laptop in a bag, sitting awake and overheating" failure mode where
|
||||
# logind missed the lid event or the compositor wedged before sleep.
|
||||
lid-suspend-watchdog-script = pkgs.writeShellScript "lid-suspend-watchdog" ''
|
||||
set -u
|
||||
LID_GLOB="/proc/acpi/button/lid/*/state"
|
||||
STAMP="/run/lid-suspend-watchdog.stamp"
|
||||
COOLDOWN=90
|
||||
|
||||
lid_closed() {
|
||||
for f in $LID_GLOB; do
|
||||
[ -f "$f" ] || continue
|
||||
grep -q "closed" "$f" && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
if ! lid_closed; then
|
||||
rm -f "$STAMP"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Already suspending/suspended, or a suspend job is queued: nothing to do.
|
||||
if systemctl is-active --quiet suspend.target; then
|
||||
exit 0
|
||||
fi
|
||||
if systemctl list-jobs --no-legend 2>/dev/null | grep -q "suspend.target"; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
now=$(date +%s)
|
||||
last=$(cat "$STAMP" 2>/dev/null || echo 0)
|
||||
if [ $((now - last)) -ge "$COOLDOWN" ]; then
|
||||
echo "$now" > "$STAMP"
|
||||
echo "lid-suspend-watchdog: lid closed and system still awake — forcing suspend"
|
||||
systemctl suspend
|
||||
fi
|
||||
'';
|
||||
in
|
||||
{
|
||||
options.skyg.nixos.common.hardware.laptop-power-mgr = with lib; {
|
||||
enable = mkEnableOption "Settings for laptop power management";
|
||||
|
||||
enableLidSuspendWatchdog = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Enable a safety-net watchdog that periodically checks the lid switch
|
||||
and forces a suspend whenever the lid is closed but the machine is
|
||||
still awake (e.g. logind missed the lid event, or the compositor
|
||||
wedged on s2idle). Without this, a laptop can sit closed in a bag,
|
||||
fully awake, and overheat.
|
||||
'';
|
||||
};
|
||||
|
||||
enableTempMonitor = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
@@ -300,5 +352,26 @@ in
|
||||
StandardError = "journal";
|
||||
};
|
||||
};
|
||||
|
||||
# Safety-net suspend watchdog: periodically check the lid, suspend if the
|
||||
# lid is closed but the machine is still awake. Only enabled if
|
||||
# enableLidSuspendWatchdog is true.
|
||||
systemd.services.lid-suspend-watchdog = lib.mkIf cfg.enableLidSuspendWatchdog {
|
||||
description = "Force suspend when the lid is closed but the system is still awake";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${lid-suspend-watchdog-script}";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.timers.lid-suspend-watchdog = lib.mkIf cfg.enableLidSuspendWatchdog {
|
||||
description = "Periodic lid-closed suspend check";
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnBootSec = "2m";
|
||||
OnUnitActiveSec = "1m";
|
||||
AccuracySec = "10s";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -21,11 +21,12 @@ This folder only holds `default.nix`, which:
|
||||
hermenix: the options belong to an external flake.
|
||||
- **hermes-agent pin**: the input follows this repo's `hermes-agent`, so
|
||||
robots pin the same revision the host locked.
|
||||
- **Buzz stays here**: robotnix knows nothing about Buzz. A robot's seed
|
||||
config (e.g. `hosts/hl-fwdesk/services/robotnix/sibli.nix`) builds
|
||||
`pkgs/buzz-cli` from this repo and sets `BUZZ_CLI_PATH` itself. That
|
||||
relative path works for the seed build only, which is fine for ephemeral
|
||||
robots; a persistent robot that rebuilds itself would need its own copy.
|
||||
- **Buzz stays here**: robotnix knows nothing about Buzz. The robots' shared
|
||||
`hosts/hl-fwdesk/services/robotnix/buzz.nix` builds `pkgs/buzz-cli` from
|
||||
this repo and sets `BUZZ_CLI_PATH`. Robots get copies of it, `common.nix`
|
||||
and `pkgs/buzz-cli` under `/etc/nixos/seed` (robotnix `seed.extraFiles`,
|
||||
`seedOf` in the host file), so a robot that rebuilds itself (genix) has
|
||||
its own copy.
|
||||
- **nspawn, not `oci-containers`**: the oci-containers rule targets
|
||||
Docker/Podman. nspawn robots need their own store for self-rebuilds, which
|
||||
the `containers.*` module can't give.
|
||||
Reference in new issue
Block a user