Powersave: Move tlp to laptop powersave.

This commit is contained in:
Dmitry Voronin 2025-01-12 08:56:20 +03:00
parent 68e104dd73
commit 57b5606e27
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
3 changed files with 42 additions and 23 deletions

View file

@ -34,12 +34,9 @@ let
''; '';
in in
{ {
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable (
services = { lib.mkMerge [
tlp.enable = true; {
upower.enable = true;
};
environment.systemPackages = [ script ]; environment.systemPackages = [ script ];
systemd = { systemd = {
services.powersave-cpu = { services.powersave-cpu = {
@ -57,5 +54,14 @@ in
# HACK: Allow user access. # HACK: Allow user access.
tmpfiles.rules = [ "z ${cfg.cpu.boost.controlFile} 0777 - - - -" ]; tmpfiles.rules = [ "z ${cfg.cpu.boost.controlFile} 0777 - - - -" ];
}; };
}; }
(lib.mkIf cfg.laptop {
services = {
tlp.enable = true;
upower.enable = true;
};
})
]
);
} }

View file

@ -1,4 +1,10 @@
{ __findFile, config, lib, pkgs, ... }: {
__findFile,
config,
lib,
pkgs,
...
}:
{ {
enable = true; enable = true;
package = pkgs.thunderbird-esr; package = pkgs.thunderbird-esr;

View file

@ -1,7 +1,14 @@
{ lib, ... }: { lib, config, ... }:
let
purpose = config.module.purpose;
in
{ {
options.module.powersave = { options.module.powersave = {
enable = lib.mkEnableOption "the powersave"; enable = lib.mkEnableOption "the powersave";
laptop = lib.mkOption {
default = purpose.laptop;
type = lib.types.bool;
};
cpu.boost = { cpu.boost = {
disableCmd = lib.mkOption { disableCmd = lib.mkOption {
default = null; default = null;