NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.05k stars 14.08k forks source link

Laptop hibernates with lid closed even when `lidSwitchExternalPower = "ignore"` on unstable #331602

Open StoicDeveloper opened 3 months ago

StoicDeveloper commented 3 months ago

Describe the bug

When on unstable branch, and services.logind.lidSwitchExternalPower = "ignore" is set, closing the laptop lid will trigger the default behaviour. In my case the result was that the computer disconnects from the network, such that it can no longer be controlled from SSH and instead requires manual intervention.

Steps To Reproduce

Steps to reproduce the behavior:

  1. With laptop lid closed, and connected over SSH, start on stable, install unstable branch with services.logind.lidSwitchExternalPower = "ignore" in configuration.nix
  2. Rebuild, and notice that the computer still works
  3. Reboot
  4. SSH connection doesn't reopen, and can now only be accessed while the laptop lid is open

Expected behavior

lidSwitch options will operate as described in the docs. That is, the laptop will not hibernate when closed, and will still be accessible over ssh.

Additional context

Resetting back to stable branch fixes the problem.

Notify maintainers

@nh2

Metadata

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.42, NixOS, 24.11 (Vicuna), 24.11pre659698.52ec9ac3b123`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a :+1: reaction to issues you find important.

donovanglover commented 3 months ago

Haven't tried 52ec9ac3b123 yet but works for me with 1d9c2c9b3e71b9ee663d11c5d298727dace8d374 and services.logind.lidSwitch. Not using SSH though, and not rebooting with the lid closed.