|
16 | 16 | limit != null && window != null |
17 | 17 | ) "Both power limit and window must be set"; |
18 | 18 | "${toString limit} ${toString window}"; |
19 | | - cliArgs = lib.cli.toCommandLineGNU { } { |
20 | | - inherit (cfg) |
21 | | - verbose |
22 | | - temp |
23 | | - turbo |
24 | | - ; |
25 | | - # `core` and `cache` are both intentionally set to `cfg.coreOffset` as according to the undervolt docs: |
26 | | - # |
27 | | - # Core or Cache offsets have no effect. It is not possible to set different offsets for |
28 | | - # CPU Core and Cache. The CPU will take the smaller of the two offsets, and apply that to |
29 | | - # both CPU and Cache. A warning message will be displayed if you attempt to set different offsets. |
30 | | - core = cfg.coreOffset; |
31 | | - cache = cfg.coreOffset; |
32 | | - gpu = cfg.gpuOffset; |
33 | | - uncore = cfg.uncoreOffset; |
34 | | - analogio = cfg.analogioOffset; |
35 | | - |
36 | | - temp-bat = cfg.tempBat; |
37 | | - temp-ac = cfg.tempAc; |
38 | | - |
39 | | - power-limit-long = mkPLimit cfg.p1.limit cfg.p1.window; |
40 | | - power-limit-short = mkPLimit cfg.p2.limit cfg.p2.window; |
41 | | - }; |
| 19 | + cliArgs = |
| 20 | + let |
| 21 | + optionFormat = optionName: { |
| 22 | + option = "--${optionName}"; |
| 23 | + sep = null; |
| 24 | + explicitBool = false; |
| 25 | + }; |
| 26 | + in |
| 27 | + lib.cli.toCommandLine optionFormat { |
| 28 | + inherit (cfg) |
| 29 | + verbose |
| 30 | + temp |
| 31 | + turbo |
| 32 | + ; |
| 33 | + # `core` and `cache` are both intentionally set to `cfg.coreOffset` as according to the undervolt docs: |
| 34 | + # |
| 35 | + # Core or Cache offsets have no effect. It is not possible to set different offsets for |
| 36 | + # CPU Core and Cache. The CPU will take the smaller of the two offsets, and apply that to |
| 37 | + # both CPU and Cache. A warning message will be displayed if you attempt to set different offsets. |
| 38 | + core = cfg.coreOffset; |
| 39 | + cache = cfg.coreOffset; |
| 40 | + gpu = cfg.gpuOffset; |
| 41 | + uncore = cfg.uncoreOffset; |
| 42 | + analogio = cfg.analogioOffset; |
| 43 | + |
| 44 | + temp-bat = cfg.tempBat; |
| 45 | + temp-ac = cfg.tempAc; |
| 46 | + |
| 47 | + power-limit-long = mkPLimit cfg.p1.limit cfg.p1.window; |
| 48 | + power-limit-short = mkPLimit cfg.p2.limit cfg.p2.window; |
| 49 | + }; |
42 | 50 | in |
43 | 51 | { |
44 | 52 | options.services.undervolt = { |
|
0 commit comments