From 4eef19791387f387c6be83663d67ab5d06187494 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Mon, 17 Feb 2025 22:21:26 -0500 Subject: [PATCH] thunderbird, firefox: don't create native host dirs when program is off Before the patch, both directories for firefox and thunderbird were created, even when only one of the programs was enabled. Signed-off-by: Ihar Hrachyshka --- modules/misc/mozilla-messaging-hosts.nix | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/modules/misc/mozilla-messaging-hosts.nix b/modules/misc/mozilla-messaging-hosts.nix index 45d1ce4b..ec66aa69 100644 --- a/modules/misc/mozilla-messaging-hosts.nix +++ b/modules/misc/mozilla-messaging-hosts.nix @@ -58,17 +58,19 @@ in { paths = defaultPaths ++ cfg.thunderbirdNativeMessagingHosts; }; in { - "${thunderbirdNativeMessagingHostsPath}" = { - source = - "${thunderbirdNativeMessagingHostsJoined}/lib/mozilla/native-messaging-hosts"; - recursive = true; - }; + "${thunderbirdNativeMessagingHostsPath}" = + mkIf (cfg.thunderbirdNativeMessagingHosts != [ ]) { + source = + "${thunderbirdNativeMessagingHostsJoined}/lib/mozilla/native-messaging-hosts"; + recursive = true; + }; - "${firefoxNativeMessagingHostsPath}" = { - source = - "${firefoxNativeMessagingHostsJoined}/lib/mozilla/native-messaging-hosts"; - recursive = true; - }; + "${firefoxNativeMessagingHostsPath}" = + mkIf (cfg.firefoxNativeMessagingHosts != [ ]) { + source = + "${firefoxNativeMessagingHostsJoined}/lib/mozilla/native-messaging-hosts"; + recursive = true; + }; } else let