From c86207766ecb229619397101fa48a201faefee14 Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Wed, 14 Aug 2024 15:45:57 +0200 Subject: [PATCH] nixos-mods/improvedDefaults: add powertop-tlp --- .../improvedDefaults/default.nix | 1 + .../improvedDefaults/powertop-tlp.nix | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 nix/nixos-modules/improvedDefaults/powertop-tlp.nix diff --git a/nix/nixos-modules/improvedDefaults/default.nix b/nix/nixos-modules/improvedDefaults/default.nix index db2aad0..4822120 100644 --- a/nix/nixos-modules/improvedDefaults/default.nix +++ b/nix/nixos-modules/improvedDefaults/default.nix @@ -11,6 +11,7 @@ in imports = [ ./command-not-found.nix + ./powertop-tlp.nix ]; diff --git a/nix/nixos-modules/improvedDefaults/powertop-tlp.nix b/nix/nixos-modules/improvedDefaults/powertop-tlp.nix new file mode 100644 index 0000000..08bd116 --- /dev/null +++ b/nix/nixos-modules/improvedDefaults/powertop-tlp.nix @@ -0,0 +1,30 @@ +{ config +, lib +, pkgs +, ... +}: +let + cfg = config.x-banananetwork.improvedDefaults; +in +{ + + + config = lib.mkIf cfg.enable ( + let + powertop = config.powerManagement.powertop; + tlp = config.services.tlp; + in + { + + assertions = [ + { + assertion = tlp.enable -> !powertop.enable; + message = "tlp makes powertop service useless, see https://linrunner.de/tlp/faq/powertop.html#does-powertop-conflict-with-tlp"; + } + ]; + + } + ); + + +}