From 83833bf871dfa37d1e76bc48a45eca384200217c Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Thu, 3 Sep 2026 22:00:21 +0800 Subject: [PATCH] fix: use valid shoukei logind keys --- hosts/12kingdoms-shoukei/apple-silicon.nix | 10 +++++----- .../tests/shoukei-logind/expected.nix | 10 ++++++++++ .../tests/shoukei-logind/expr.nix | 18 ++++++++++++++++++ 3 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 outputs/aarch64-linux/tests/shoukei-logind/expected.nix create mode 100644 outputs/aarch64-linux/tests/shoukei-logind/expr.nix diff --git a/hosts/12kingdoms-shoukei/apple-silicon.nix b/hosts/12kingdoms-shoukei/apple-silicon.nix index 35585cd1..60c0f5b5 100644 --- a/hosts/12kingdoms-shoukei/apple-silicon.nix +++ b/hosts/12kingdoms-shoukei/apple-silicon.nix @@ -54,13 +54,13 @@ # # NOTE: Hibernate is not supported by Asahi Linux. services.logind.settings.Login = { - lidSwitch = "suspend"; - lidSwitchExternalPower = "lock"; + HandleLidSwitch = "suspend"; + HandleLidSwitchExternalPower = "suspend"; # 'Docked' means: more than one display is connected or the system is inserted in a docking station - lidSwitchDocked = "ignore"; + HandleLidSwitchDocked = "ignore"; - powerKey = "suspend"; - powerKeyLongPress = "poweroff"; + HandlePowerKey = "suspend"; + HandlePowerKeyLongPress = "poweroff"; }; systemd.targets.sleep.enable = true; systemd.sleep.settings.Sleep = { diff --git a/outputs/aarch64-linux/tests/shoukei-logind/expected.nix b/outputs/aarch64-linux/tests/shoukei-logind/expected.nix new file mode 100644 index 00000000..9fd92490 --- /dev/null +++ b/outputs/aarch64-linux/tests/shoukei-logind/expected.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + lidSwitch = "suspend"; + lidSwitchExternalPower = "suspend"; + lidSwitchDocked = "ignore"; + powerKey = "suspend"; + powerKeyLongPress = "poweroff"; + + oldLowercaseKeysAbsent = true; +} diff --git a/outputs/aarch64-linux/tests/shoukei-logind/expr.nix b/outputs/aarch64-linux/tests/shoukei-logind/expr.nix new file mode 100644 index 00000000..48345a59 --- /dev/null +++ b/outputs/aarch64-linux/tests/shoukei-logind/expr.nix @@ -0,0 +1,18 @@ +{ outputs, ... }: +let + login = outputs.nixosConfigurations.shoukei-niri.config.services.logind.settings.Login; +in +{ + lidSwitch = login.HandleLidSwitch or null; + lidSwitchExternalPower = login.HandleLidSwitchExternalPower or null; + lidSwitchDocked = login.HandleLidSwitchDocked or null; + powerKey = login.HandlePowerKey or null; + powerKeyLongPress = login.HandlePowerKeyLongPress or null; + + oldLowercaseKeysAbsent = + !(login ? lidSwitch) + && !(login ? lidSwitchExternalPower) + && !(login ? lidSwitchDocked) + && !(login ? powerKey) + && !(login ? powerKeyLongPress); +}