aboutsummaryrefslogtreecommitdiffstats
path: root/modules/communication/neomutt/default.nix
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-08-29 02:02:23 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-08-29 03:50:32 +0530
commit41bdeb88009dd232808edee9fc0e4ae94358d8d6 (patch)
treec1a41f54e086064dac178ebed24d36ab34087c32 /modules/communication/neomutt/default.nix
parent530299d97926d45939f831dc3ea5e444d2839d08 (diff)
downloadhome-manager-config-41bdeb88009dd232808edee9fc0e4ae94358d8d6.tar.gz
home-manager-config-41bdeb88009dd232808edee9fc0e4ae94358d8d6.zip
refactor: moving script into modules that makes sense
- instead of collecting all scripts into modules/scripts we are moving them to modules that makes sense (yazi-file-chooser.sh into yazi)
Diffstat (limited to 'modules/communication/neomutt/default.nix')
-rw-r--r--modules/communication/neomutt/default.nix47
1 files changed, 42 insertions, 5 deletions
diff --git a/modules/communication/neomutt/default.nix b/modules/communication/neomutt/default.nix
index 8613032..8e5d51b 100644
--- a/modules/communication/neomutt/default.nix
+++ b/modules/communication/neomutt/default.nix
@@ -2,8 +2,32 @@
{
config,
lib,
+ pkgs,
...
}:
+let
+ inherit ((import ../../lib/script.nix { inherit lib pkgs; })) mkScriptModule;
+ neomuttSync = mkScriptModule {
+ scope = [
+ "communication"
+ "neomutt"
+ ];
+ name = "neomutt-sync";
+ path = ./neomutt-sync.sh;
+ description = "Neomutt-sync - Interactive mail sync with dialog progress bar";
+ deps = [
+ pkgs.bash
+ pkgs.dialog
+ pkgs.coreutils
+ pkgs.gawk
+ pkgs.gnused
+ pkgs.util-linux
+ config.programs.mbsync.package
+ config.programs.notmuch.package
+ ];
+ inherit config;
+ };
+in
{
imports = [
./account
@@ -23,10 +47,23 @@
default = config.programs.neomutt.package;
description = "The neomutt package to use, wrapped with urlscan in PATH.";
};
- };
+ }
+ // neomuttSync.options.communication.neomutt;
- config = lib.mkIf config.communication.neomutt.enable {
- accounts.email.maildirBasePath = "${config.home.homeDirectory}/.local/share/mail";
- home.sessionVariables.MAILDIR = config.accounts.email.maildirBasePath;
- };
+ config = lib.mkMerge [
+ (lib.mkIf config.communication.neomutt.enable {
+ accounts.email.maildirBasePath = "${config.home.homeDirectory}/.local/share/mail";
+ home.sessionVariables.MAILDIR = config.accounts.email.maildirBasePath;
+ })
+ neomuttSync.config
+ {
+ assertions = [
+ {
+ assertion =
+ !config.communication.neomutt.neomutt-sync.enable || config.communication.neomutt.enable;
+ message = "communication.neomutt.neomutt-sync is enabled but requires `communication.neomutt.enable`.";
+ }
+ ];
+ }
+ ];
}