aboutsummaryrefslogtreecommitdiffstats
path: root/modules/communication/neomutt/account
diff options
context:
space:
mode:
Diffstat (limited to 'modules/communication/neomutt/account')
-rw-r--r--modules/communication/neomutt/account/.muttrc2
-rw-r--r--modules/communication/neomutt/account/default.nix2
-rw-r--r--modules/communication/neomutt/account/flavors/gmail/.muttrc2
-rw-r--r--modules/communication/neomutt/account/flavors/gmail/default.nix (renamed from modules/communication/neomutt/account/flavors/gmail.nix)5
-rw-r--r--modules/communication/neomutt/account/sync-channel.nix13
5 files changed, 14 insertions, 10 deletions
diff --git a/modules/communication/neomutt/account/.muttrc b/modules/communication/neomutt/account/.muttrc
new file mode 100644
index 0000000..2f8c9f2
--- /dev/null
+++ b/modules/communication/neomutt/account/.muttrc
@@ -0,0 +1,2 @@
+macro index,pager gs "<enter-command>set my_wait_key=$wait_key wait_key=no<enter><sync-mailbox><shell-escape>neomutt-sync @@QUICK_CHANNEL@@<enter><sync-mailbox><enter-command>set wait_key=$my_wait_key<enter>"
+macro index,pager gS "<enter-command>set my_wait_key=$wait_key wait_key=no<enter><sync-mailbox><shell-escape>neomutt-sync @@FULL_CHANNEL@@<enter><sync-mailbox><enter-command>set wait_key=$my_wait_key<enter>"
diff --git a/modules/communication/neomutt/account/default.nix b/modules/communication/neomutt/account/default.nix
index 5c0f8bf..e2d92eb 100644
--- a/modules/communication/neomutt/account/default.nix
+++ b/modules/communication/neomutt/account/default.nix
@@ -9,8 +9,8 @@
type = lib.types.attrsOf (
lib.types.submodule {
imports = [
+ ./flavors/gmail
./options.nix
- ./flavors/gmail.nix
./sync-channel.nix
];
}
diff --git a/modules/communication/neomutt/account/flavors/gmail/.muttrc b/modules/communication/neomutt/account/flavors/gmail/.muttrc
new file mode 100644
index 0000000..c87bba0
--- /dev/null
+++ b/modules/communication/neomutt/account/flavors/gmail/.muttrc
@@ -0,0 +1,2 @@
+mailboxes =Inbox ="[Gmail]/Drafts" ="[Gmail]/Sent Mail" ="[Gmail]/Spam" ="[Gmail]/Trash"
+unset record
diff --git a/modules/communication/neomutt/account/flavors/gmail.nix b/modules/communication/neomutt/account/flavors/gmail/default.nix
index 9cb51b2..66d7db3 100644
--- a/modules/communication/neomutt/account/flavors/gmail.nix
+++ b/modules/communication/neomutt/account/flavors/gmail/default.nix
@@ -30,10 +30,7 @@
};
};
- neomutt.extraConfig = lib.mkBefore ''
- mailboxes =Inbox ="[Gmail]/Drafts" ="[Gmail]/Sent Mail" ="[Gmail]/Spam" ="[Gmail]/Trash"
- unset record
- '';
+ neomutt.extraConfig = lib.mkBefore (builtins.readFile ./.muttrc);
notmuch.neomutt.virtualMailboxes = lib.mkDefault [
{
diff --git a/modules/communication/neomutt/account/sync-channel.nix b/modules/communication/neomutt/account/sync-channel.nix
index 7e538f2..6f3bd54 100644
--- a/modules/communication/neomutt/account/sync-channel.nix
+++ b/modules/communication/neomutt/account/sync-channel.nix
@@ -3,7 +3,7 @@
lib,
name,
...
-}@inputs:
+}:
let
mbsyncNamesFromName = (import ../lib.nix { inherit lib; }).mbsyncNamesFromName;
@@ -14,9 +14,12 @@ in
let
mbsyncNames = mbsyncNamesFromName name;
in
- ''
- macro index,pager gs "<enter-command>set my_wait_key=$wait_key wait_key=no<enter><sync-mailbox><shell-escape>neomutt-sync ${mbsyncNames.channels.quick}<enter><sync-mailbox><enter-command>set wait_key=$my_wait_key<enter>"
- macro index,pager gS "<enter-command>set my_wait_key=$wait_key wait_key=no<enter><sync-mailbox><shell-escape>neomutt-sync ${mbsyncNames.channels.full}<enter><sync-mailbox><enter-command>set wait_key=$my_wait_key<enter>"
- '';
+ builtins.replaceStrings
+ [ "@@QUICK_CHANNEL@@" "@@FULL_CHANNEL@@" ]
+ [
+ mbsyncNames.channels.quick
+ mbsyncNames.channels.full
+ ]
+ (builtins.readFile ./.muttrc);
};
}