From 97134b4bb89064aac2f930f0ba7afdc34f08afa3 Mon Sep 17 00:00:00 2001 From: Mark Nipper Date: Fri, 22 Nov 2024 15:46:36 -0800 Subject: Fix conditional syntax --- hosts/common/optional/services/tlp.nix | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/hosts/common/optional/services/tlp.nix b/hosts/common/optional/services/tlp.nix index 64f1960..f13a7b3 100644 --- a/hosts/common/optional/services/tlp.nix +++ b/hosts/common/optional/services/tlp.nix @@ -1,17 +1,18 @@ {config, lib, ...}: { - services.tlp = lib.mkIf ((builtins.match "^(jupiter|neptune|saturn|uranus)$" config.networking.hostName) != null) { - enable = true; - settings = { - START_CHARGE_THRESH_BAT0 = 40; - STOP_CHARGE_THRESH_BAT0 = 50; - }; - }; - - services.tlp = lib.mkIf (config.networking.hostName == "ginaz") { - enable = true; - settings = { - STOP_CHARGE_THRESH_BAT0 = 1; - }; - }; + services.tlp = lib.mkMerge [ + (lib.mkIf ((builtins.match "^(jupiter|neptune|saturn|uranus)$" config.networking.hostName) != null) { + enable = true; + settings = { + START_CHARGE_THRESH_BAT0 = 40; + STOP_CHARGE_THRESH_BAT0 = 50; + }; + }) + (lib.mkIf (config.networking.hostName == "ginaz") { + enable = true; + settings = { + STOP_CHARGE_THRESH_BAT0 = 1; + }; + }) + ]; } -- cgit v1.2.3