diff --git a/hosts/framenix/default.nix b/hosts/framenix/default.nix index de8c815..feb58c5 100644 --- a/hosts/framenix/default.nix +++ b/hosts/framenix/default.nix @@ -35,6 +35,18 @@ in "amdgpu.abmlevel=1" # adaptive backlight management ]; + # at boot by default, limit charging capacity to protect battery. + # Hopefully there's gonna be a standard interface to control this from the desktop at some point. + systemd.services.battery-charge-limit = { + wantedBy = [ "basic.target" ]; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${lib.getExe pkgs.framework-tool} --driver portio --charge-limit 85"; + RemainAfterExit = true; + }; + }; + + boot.loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true;