nixos: gen 261 @ violet — 2026-11-01 11:44 26.05.20261031.fa13731 (Yarara) ----- disabling magnetic wake on thinkpad (violet)
This commit is contained in:
+16
-21
@@ -11,39 +11,34 @@
|
||||
|
||||
services.power-profiles-daemon.enable = true;
|
||||
services.hardware.bolt.enable = true;
|
||||
services.logind = {
|
||||
settings = {
|
||||
Login.HandleLidSwitch = "ignore";
|
||||
Login.lidSwitchDocked = "ignore";
|
||||
Login.lidSwitchExternalPower = "ignore";
|
||||
};
|
||||
};
|
||||
|
||||
services.input-remapper.enable = true;
|
||||
|
||||
system.stateVersion = "26.05";
|
||||
|
||||
boot.kernelModules = [ "bnep" ];
|
||||
#boot.kernelModules = [ "bnep" ];
|
||||
|
||||
networking.interfaces.bnep0.ipv4.addresses = [{
|
||||
address = "10.0.0.2";
|
||||
prefixLength = 24;
|
||||
}];
|
||||
#networking.interfaces.bnep0.ipv4.addresses = [{
|
||||
# address = "10.0.0.2";
|
||||
# prefixLength = 24;
|
||||
#}];
|
||||
|
||||
networking.firewall.interfaces."bnep0".allowedUDPPorts = [ 4242 ];
|
||||
#networking.firewall.interfaces."bnep0".allowedUDPPorts = [ 4242 ];
|
||||
|
||||
systemd = {
|
||||
services = {
|
||||
bt-pan-client = {
|
||||
description = "Bluetooth PAN Client Connection to Device A";
|
||||
after = [ "bluetooth.service" ];
|
||||
disable-lid-wakeup = {
|
||||
description = "Disable ACPI wakeup by magnetic lid sensor";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
# Replace XX:XX:XX:XX:XX:XX with Device B's actual Bluetooth MAC Address
|
||||
ExecStartPre = "${pkgs.bluez}/bin/bluetoothctl trust 84:D1:C1:A9:EE:52";
|
||||
ExecStart = "${pkgs.bluez-tools}/bin/bt-network -c 84:D1:C1:A9:EE:52 bnep";
|
||||
Restart = "always";
|
||||
RestartSec = 10; # Retry every 10 seconds if Device B goes out of range
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStart = pkgs.writeShellScript "disable-lid-wakeup" ''
|
||||
grep -E '^LID.*\*enabled' /proc/acpi/wakeup | cut -f1 | while read -r dev; do
|
||||
echo "$dev" > /proc/acpi/wakeup
|
||||
done
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user