From 3e46f9520b574cd62cfa7475f800c89ffe25162e Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 27 Mar 2017 23:41:50 +0200 Subject: Rename prevent-suspend --- hel.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hel.nix b/hel.nix index 0bce9f83..ac54b82a 100644 --- a/hel.nix +++ b/hel.nix @@ -475,7 +475,7 @@ systemd.user.services."ssh-agent".enable = lib.mkForce false; systemd.user.sockets."pulseaudio".enable = lib.mkForce false; - systemd.services."prevent-suspend" = { + systemd.services."ac-plugged" = { description = "Inhibit handling of lid-switch and sleep"; path = with pkgs; @@ -484,7 +484,7 @@ script = '' #!{pkgs.stdenv.shell} - exec systemd-inhibit --what=handle-lid-switch:sleep --why="prevent-suspend.service" --mode=block sleep infinity + exec systemd-inhibit --what=handle-lid-switch:sleep --why="AC is connected" --mode=block sleep infinity ''; serviceConfig = { @@ -493,8 +493,8 @@ }; services.udev.extraRules = with pkgs; '' - SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", RUN+="${systemd}/bin/systemctl --no-block stop prevent-suspend.service" - SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="${systemd}/bin/systemctl --no-block start prevent-suspend.service" + SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", RUN+="${systemd}/bin/systemctl --no-block stop ac-plugged.service" + SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="${systemd}/bin/systemctl --no-block start ac-plugged.service" ''; } -- cgit v1.2.3