summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2017-03-27 23:41:50 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2017-03-27 23:41:50 +0200
commit3e46f9520b574cd62cfa7475f800c89ffe25162e (patch)
tree92fea3bae2d52c54a2cebe84e359a7e3be69073e
parent2c7ae60d18bcae340b09c2754eef6ad5d86b6d9e (diff)
downloadnixos-3e46f9520b574cd62cfa7475f800c89ffe25162e.tar
nixos-3e46f9520b574cd62cfa7475f800c89ffe25162e.tar.gz
nixos-3e46f9520b574cd62cfa7475f800c89ffe25162e.tar.bz2
nixos-3e46f9520b574cd62cfa7475f800c89ffe25162e.tar.xz
nixos-3e46f9520b574cd62cfa7475f800c89ffe25162e.zip
Rename prevent-suspend
-rw-r--r--hel.nix8
1 files 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 @@
475 systemd.user.services."ssh-agent".enable = lib.mkForce false; 475 systemd.user.services."ssh-agent".enable = lib.mkForce false;
476 systemd.user.sockets."pulseaudio".enable = lib.mkForce false; 476 systemd.user.sockets."pulseaudio".enable = lib.mkForce false;
477 477
478 systemd.services."prevent-suspend" = { 478 systemd.services."ac-plugged" = {
479 description = "Inhibit handling of lid-switch and sleep"; 479 description = "Inhibit handling of lid-switch and sleep";
480 480
481 path = with pkgs; 481 path = with pkgs;
@@ -484,7 +484,7 @@
484 script = '' 484 script = ''
485 #!{pkgs.stdenv.shell} 485 #!{pkgs.stdenv.shell}
486 486
487 exec systemd-inhibit --what=handle-lid-switch:sleep --why="prevent-suspend.service" --mode=block sleep infinity 487 exec systemd-inhibit --what=handle-lid-switch:sleep --why="AC is connected" --mode=block sleep infinity
488 ''; 488 '';
489 489
490 serviceConfig = { 490 serviceConfig = {
@@ -493,8 +493,8 @@
493 }; 493 };
494 494
495 services.udev.extraRules = with pkgs; '' 495 services.udev.extraRules = with pkgs; ''
496 SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", RUN+="${systemd}/bin/systemctl --no-block stop prevent-suspend.service" 496 SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", RUN+="${systemd}/bin/systemctl --no-block stop ac-plugged.service"
497 SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="${systemd}/bin/systemctl --no-block start prevent-suspend.service" 497 SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="${systemd}/bin/systemctl --no-block start ac-plugged.service"
498 ''; 498 '';
499} 499}
500 500