Summary Files Commits Branches @commit @diff @stats
path: root / machines / juno / configuration.nix
blob: 85d00d3ea5ca559ea921170307e24a9b77e5265c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ pkgs, ... }: {
  environment.systemPackages = with pkgs; [
    thinkfan xf86-input-synaptics
  ];

  # External third-party battery is no longer able to hold 100% charge without getting "stuck"
  # Often this would result in an immediate shutdown, since there would be either a short or voltage surge
  # My guess is the problem lies with the controller
  # I've twice been able to rejuvenate it by just retrying and retrying to discharge it
  # So, this service is here, if that happens again, it should be enabled and then on every bootup when charger is connected
  # it will try to discharge battery, which will result in shutdown.
  systemd.services.extdrain = {
    enable = false;
    wantedBy = [ "multi-user.target" ];
    unitConfig = {
      Type = "simple";
    };
    path = [ pkgs.tlp ];
    serviceConfig = {
      ExecStart = "${pkgs.tlp}/bin/tlp discharge BAT1";
    };
  };

  services.thinkfan = {
    enable = true;
    levels = [
      [0  0 35]
      [1 35 38]
      [3 38 53]
      ["level auto" 53 32767]
    ];
  };
}