aboutsummaryrefslogtreecommitdiffstats
path: root/modules/communication/neomutt/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/communication/neomutt/default.nix')
-rw-r--r--modules/communication/neomutt/default.nix18
1 files changed, 16 insertions, 2 deletions
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;
};
};
})