File tree Expand file tree Collapse file tree 4 files changed +34
-7
lines changed Expand file tree Collapse file tree 4 files changed +34
-7
lines changed Original file line number Diff line number Diff line change 6
6
../../../common/gpu/amd
7
7
../../../common/pc/laptop
8
8
../../../common/pc/laptop/ssd
9
- ../../battery.nix
9
+ ../../../common/pc/laptop/ battery.nix
10
10
] ;
11
11
12
12
# 6.5 adds many fixes and improvements for the Ally
Original file line number Diff line number Diff line change 6
6
../../../common/gpu/nvidia/prime.nix
7
7
../../../common/pc/laptop
8
8
../../../common/pc/ssd
9
- ../../battery.nix
9
+ ../../../common/pc/laptop/ battery.nix
10
10
] ;
11
11
12
12
hardware . nvidia . prime = {
Original file line number Diff line number Diff line change 5
5
../../../common/gpu/nvidia/prime.nix
6
6
../../../common/pc/laptop
7
7
../../../common/pc/ssd
8
- ../../battery.nix
8
+ ../../../common/pc/laptop/ battery.nix
9
9
] ;
10
10
11
11
# fixing audio by overriding pins as suggested in
Original file line number Diff line number Diff line change 1
- { config , pkgs , lib , ... } :
1
+ {
2
+ config ,
3
+ pkgs ,
4
+ lib ,
5
+ ...
6
+ } :
2
7
let
3
8
p = pkgs . writeScriptBin "charge-upto" ''
4
9
echo '' ${0:-100} > /sys/class/power_supply/BAT?/charge_control_end_threshold
7
12
in
8
13
9
14
{
10
- options . hardware . asus . battery = {
15
+ options . hardware . battery = {
11
16
chargeUpto = lib . mkOption {
12
17
description = "Maximum level of charge for your battery, as a percentage." ;
13
18
default = 100 ;
19
24
type = lib . types . bool ;
20
25
} ;
21
26
} ;
27
+ imports = (
28
+ map
29
+ (
30
+ option :
31
+ lib . mkRemovedOptionModule [
32
+ "hardware"
33
+ "asus"
34
+ "battery"
35
+ option
36
+ ] "The hardware.asus.battery.* options were removed in favor of `hardware.battery.*`."
37
+ )
38
+ [
39
+ "chargeUpto"
40
+ "enableChargeUptoScript"
41
+ ]
42
+ ) ;
22
43
config = {
23
44
environment . systemPackages = lib . mkIf cfg . enableChargeUptoScript [ p ] ;
24
45
systemd . services . battery-charge-threshold = {
25
- wantedBy = [ "local-fs.target" "suspend.target" ] ;
26
- after = [ "local-fs.target" "suspend.target" ] ;
46
+ wantedBy = [
47
+ "local-fs.target"
48
+ "suspend.target"
49
+ ] ;
50
+ after = [
51
+ "local-fs.target"
52
+ "suspend.target"
53
+ ] ;
27
54
description = "Set the battery charge threshold to ${ toString cfg . chargeUpto } %" ;
28
55
startLimitBurst = 5 ;
29
56
startLimitIntervalSec = 1 ;
You can’t perform that action at this time.
0 commit comments