From ef407d62dc80b45c290c70706053fc0b2c35a731 Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Mon, 23 Oct 2023 21:13:48 +0200 Subject: [PATCH] pinwheel: Add `tlp` module --- hosts/pinwheel/configuration.nix | 1 + hosts/pinwheel/modules/tlp/default.nix | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 hosts/pinwheel/modules/tlp/default.nix diff --git a/hosts/pinwheel/configuration.nix b/hosts/pinwheel/configuration.nix index 0748b89..fa6c547 100644 --- a/hosts/pinwheel/configuration.nix +++ b/hosts/pinwheel/configuration.nix @@ -82,6 +82,7 @@ hyprland.enable = true; swaylock.enable = false; physlock.enable = true; + tlp.enable = true; git.enable = true; openvpn.enable = true; go.enable = true; diff --git a/hosts/pinwheel/modules/tlp/default.nix b/hosts/pinwheel/modules/tlp/default.nix new file mode 100644 index 0000000..4d553a4 --- /dev/null +++ b/hosts/pinwheel/modules/tlp/default.nix @@ -0,0 +1,24 @@ +{ lib, config, ... }: +let + enabled = config.mod.tlp.enable; +in +{ + options = { + mod.tlp = { + enable = lib.mkEnableOption "enable tlp module"; + }; + }; + + config = lib.mkIf enabled { + services = { + tlp = { + enable = true; + + settings = { + START_CHARGE_THRESH_BAT0=75; + STOP_CHARGE_THRESH_BAT0=80; + }; + }; + }; + }; +}