From 24725903c82c555670ad5ba108ca5d75da124a90 Mon Sep 17 00:00:00 2001 From: Veselin Ivanov Date: Sun, 15 Dec 2024 15:51:45 +0200 Subject: [PATCH] yabai: simplify config file concatenation --- modules/services/yabai/default.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/services/yabai/default.nix b/modules/services/yabai/default.nix index 3c4c9e06..512b987f 100644 --- a/modules/services/yabai/default.nix +++ b/modules/services/yabai/default.nix @@ -16,14 +16,15 @@ let sudo yabai --load-sa ''; - configFile = mkIf (cfg.config != { } || cfg.extraConfig != "") + configFile = mkIf (cfg.config != {} || cfg.extraConfig != "") "${pkgs.writeScript "yabairc" ( - optionalString (cfg.enableScriptingAddition) (scriptingAdditionConfig + "\n") - + optionalString (cfg.config != {}) (toYabaiConfig cfg.config) - + optionalString (cfg.extraConfig != "") ("\n" + cfg.extraConfig + "\n"))}"; -in - -{ + concatLines ( + optional (cfg.enableScriptingAddition) scriptingAdditionConfig + ++ optional (cfg.config != {}) (toYabaiConfig cfg.config) + ++ optional (cfg.extraConfig != "") cfg.extraConfig + ) + )}"; +in { options = with types; { services.yabai.enable = mkOption { type = bool;