mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2025-12-09 10:31:13 +01:00
chore: format repo using treefmt-nix and nixfmt-rfc-style
This commit is contained in:
parent
fc7c471412
commit
51e51e6014
266 changed files with 3721 additions and 2733 deletions
|
|
@ -1,4 +1,9 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
p = pkgs.writeScriptBin "charge-upto" ''
|
||||
echo ''${0:-100} > /sys/class/power_supply/BAT?/charge_control_end_threshold
|
||||
|
|
@ -22,8 +27,14 @@ in
|
|||
config = {
|
||||
environment.systemPackages = lib.mkIf cfg.enableChargeUptoScript [ p ];
|
||||
systemd.services.battery-charge-threshold = {
|
||||
wantedBy = [ "local-fs.target" "suspend.target" ];
|
||||
after = [ "local-fs.target" "suspend.target" ];
|
||||
wantedBy = [
|
||||
"local-fs.target"
|
||||
"suspend.target"
|
||||
];
|
||||
after = [
|
||||
"local-fs.target"
|
||||
"suspend.target"
|
||||
];
|
||||
description = "Set the battery charge threshold to ${toString cfg.chargeUpto}%";
|
||||
startLimitBurst = 5;
|
||||
startLimitIntervalSec = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue