From 7d2a27df2cb27adcc0b24072eafbf35585a1a398 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 7 Sep 2024 14:25:47 +0300 Subject: feat(juno): Added battery drain service (disabled by default) --- machines/juno/configuration.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/machines/juno/configuration.nix b/machines/juno/configuration.nix index 9e75d45..3799892 100644 --- a/machines/juno/configuration.nix +++ b/machines/juno/configuration.nix @@ -3,6 +3,24 @@ thinkfan xorg.xf86inputsynaptics ]; + # External third-party battery is no longer able to hold 100% charge without getting "stuck" + # Often this would result in an immediate shutdown, since there would be either a short or voltage surge + # My guess is the problem lies with the controller + # I've twice been able to rejuvenate it by just retrying and retrying to discharge it + # So, this service is here, if that happens again, it should be enabled and then on every bootup when charger is connected + # it will try to discharge battery, which will result in shutdown. + systemd.services.extdrain = { + enable = false; + wantedBy = [ "multi-user.target" ]; + unitConfig = { + Type = "simple"; + }; + path = [ pkgs.tlp ]; + serviceConfig = { + ExecStart = "${pkgs.tlp}/bin/tlp discharge BAT1"; + }; + }; + services.thinkfan = { enable = true; levels = [ -- cgit v1.3.1-23-gd82d