From 47364df49645e89d8aa03aa61c893e12ecbac366 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Mon, 23 Sep 2024 20:08:52 +0100 Subject: [PATCH] lib/types/pluginLuaConfig: use `lib.optional` instead of `lib.mkIf` This may slightly increase performance by reducing work done by the module system. --- lib/types.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/types.nix b/lib/types.nix index 11280330..38a06727 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -151,10 +151,10 @@ rec { }; }; - config.content = lib.mkMerge [ - (lib.mkIf (config.pre != null) (mkBeforeSection config.pre)) - (lib.mkIf (config.post != null) (mkAfterSection config.post)) - ]; + config.content = lib.mkMerge ( + lib.optional (config.pre != null) (mkBeforeSection config.pre) + ++ lib.optional (config.post != null) (mkAfterSection config.post) + ); } ); }