Added ROG Strix G733QS

This commit is contained in:
Pasquale
2021-11-19 00:01:56 +01:00
parent 5a7e613703
commit 6479f584f7
5 changed files with 69 additions and 0 deletions

21
asus/battery.nix Normal file
View File

@@ -0,0 +1,21 @@
{ config, pkgs, lib, ... }:
let
p = pkgs.writeScriptBin "charge-upto" ''
echo ''${0:-100} > /sys/class/power_supply/BAT0/charge_control_end_threshold
'';
cfg = config.hardware.asus;
in
{
options.hardware.asus.chargeUpto = lib.mkOption {
description = "Maximum level of charge for your battery, as a percentage.";
default = 100;
type = lib.types.int;
};
config = {
environment.systemPackages = [ p ];
systemd.tmpfiles.rules = [
"w /sys/class/power_supply/BAT0/charge_control_end_threshold - - - - ${toString cfg.chargeUpto}"
];
};
}