From 0981b6c089b483b4ecddceeffe89ed3f38561fb2 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Sun, 27 Sep 2026 04:16:50 +0530 Subject: feat(communication/neomutt): the first sync after opening neomutt is quick --- modules/communication/neomutt/default.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'modules/communication/neomutt/default.nix') diff --git a/modules/communication/neomutt/default.nix b/modules/communication/neomutt/default.nix index 6c11b03..e8915d9 100644 --- a/modules/communication/neomutt/default.nix +++ b/modules/communication/neomutt/default.nix @@ -15,6 +15,10 @@ let lib.filterAttrs (name: account: account.enable) cfg.accounts ); + quickSyncChannels = lib.mapAttrsToList (name: account: (mbsyncNamesFromName name).channels.quick) ( + lib.filterAttrs (name: account: account.enable) cfg.accounts + ); + neomuttSyncScript = pkgs.writeShellApplication { name = "neomutt-sync"; runtimeInputs = [ @@ -39,7 +43,17 @@ let config.programs.mbsync.package config.programs.notmuch.package ]; - text = builtins.readFile ./neomutt-sync-daemon.sh; + text = + builtins.replaceStrings + [ + "@@QUICK_CHANNELS@@" + "@@FULL_CHANNELS@@" + ] + [ + (lib.concatStringsSep "," quickSyncChannels) + (lib.concatStringsSep "," fullSyncChannels) + ] + (builtins.readFile ./neomutt-sync-daemon.sh); }; neomuttLauncher = pkgs.writeShellApplication { @@ -136,7 +150,7 @@ in }; Service = { Type = "simple"; - ExecStart = "${lib.getExe neomuttSyncDaemon} ${lib.concatStringsSep " " fullSyncChannels}"; + ExecStart = lib.getExe neomuttSyncDaemon; }; }; }) -- cgit v1.2.3