Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lenovo-x1: removed battery TLP threshholds #100

Merged
merged 1 commit into from Feb 19, 2019

Conversation

eyJhb
Copy link
Member

@eyJhb eyJhb commented Feb 19, 2019

Fixes #98 , as it should not be set.

@danbst
Copy link
Contributor

danbst commented Feb 19, 2019

@eyJhb can you convert removed part to module instead?

{ config, lib, ... }:
{
  options.recommendations.battery.linrunner = lib.mkOption {
    description = ''
      ThinkPad battery features means battery charge thresholds and the possibility to discharge or recalibrate the battery when AC is connected.
      Disclaimer:
        ThinkPad battery features work on IBM/Lenovo ThinkPads only!
        Any other Lenovo laptop models including IdeaPads – and other laptop brands of course – are not supported. Please do not file issues for this.
        There are no additional power saving features for ThinkPads.

      See https://linrunner.de/en/tlp/docs/tlp-faq.html#battery for more details.
    '';
    default = false;
  };
  config = lib.mkIf config.recommendations.battery.linrunner {
    services.tlp.extraConfig = ''
      START_CHARGE_THRESH_BAT0=75
      STOP_CHARGE_THRESH_BAT0=80
      CPU_SCALING_GOVERNOR_ON_BAT=powersave
      ENERGY_PERF_POLICY_ON_BAT=powersave
    '';
  };
}

@lukateras
Copy link
Member

Modules have been out of scope for this project (so far).

@lukateras lukateras merged commit a2e36c1 into NixOS:master Feb 19, 2019
@azazel75
Copy link
Contributor

You could have at least left it commented

@eyJhb eyJhb deleted the lenovo-x1-thresh branch February 19, 2019 11:27
@eyJhb
Copy link
Member Author

eyJhb commented Feb 19, 2019

I see no reason for letting it stay as a comment :)
But making a module of this could be nice, but not something I am currently up for, I just use the configuration directly in my configuration.nix.

Anyways, case closed. If anyone see fit adding something like this as a module, feel free! :)

@danbst
Copy link
Contributor

danbst commented Feb 19, 2019

@azazel75 @eyJhb I'm going to ressurect this, but as an optional module option. This indeed shouldn't be default, but is useful for certain usecases.

@eyJhb
Copy link
Member Author

eyJhb commented Feb 19, 2019

It is useful yes, but there still is the normal possibility for adding it to the configuration.nix? But yeah, options would be nice. :)

https://github.com/eyJhb/dot/blob/master/dotfiles/nixos/configuration.nix#L292-L301

danbst added a commit to danbst/nixos-hardware that referenced this pull request Feb 19, 2019
- convert `common/cpu/intel` and `common/pc/laptop/acpi_call` to proper
  modules. This allows a) descriptions and b) enable/disable instead of `import`
- enable both for thinkpad by default. Disable explicitly in specific profiles
  (for example, AMD ThinkPads don't need those). This is mostly to remove
  repetitions and make a "generic" ThinkPad config (I have E470 but none of
  profiles matches my needs).
- add `hardware.cpu.intel.max-frequency` option, which allows reducing
  CPU performance (a bit duplicates powerManagement.cpufreq.max but it's
  a separate mechanism). Perhaps should eventually move to nixpkgs?
- add `hardware.battery.powersave`, which enables some non-controversial
  power saving services. Disabled by default.
- add `hardware.battery.optimize`, which documents nuances of battery
  lifetime. Basically, ressurects deleted in NixOS#100 code
  but disabled by default.
- convert a comment about fprintd into an option `hardware.fingerprint.enable`,
  with description

What you think about this? I'm now using those options as:
```
  imports = [
    <nixos-hardware/lenovo/thinkpad>
  ];
  hardware.battery.powersave = true;
  hardware.battery.optimize = "mostly-pluggedin";
  hardware.fingerprint.enable = true;
  # increase nixos-rebuild time from 4.3s to 4.7s
  hardware.cpu.intel.max-frequency = 90;
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants