mirror of
https://github.com/nix-community/home-manager
synced 2024-12-29 13:19:47 +01:00
bf6b85136b
At the moment, only the inbox of each mail account is added to neomutt. This inbox is always called "Inbox", so if you configure multiple accounts, it is hard to know which one is which. This change allows the user to specify a display name per account that uses `named-mailboxes` under the hood. Additionally this change now allows to add other folders than the inbox, for example the Trash, Spam or Drafts folders to be added on a per-account basis. Using extraOptions is not possible here, as those are lazily loaded on mailbox open and thus would appear at the bottom and not sorted by account. This commit also changes the default sidebar format string to use %D instead of %B because %B will ignore named mailboxes and show the folder name instead.
50 lines
1.2 KiB
Nix
50 lines
1.2 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
imports = [ ../../accounts/email-test-accounts.nix ];
|
|
|
|
config = {
|
|
accounts.email.accounts = {
|
|
"hm@example.com" = {
|
|
notmuch.enable = true;
|
|
neomutt = {
|
|
enable = true;
|
|
extraConfig = ''
|
|
color status cyan default
|
|
'';
|
|
mailboxName = "someCustomName";
|
|
extraMailboxes = [
|
|
"Sent"
|
|
{
|
|
mailbox = "Junk Email";
|
|
name = "Spam";
|
|
}
|
|
{ mailbox = "Trash"; }
|
|
];
|
|
};
|
|
imap.port = 993;
|
|
};
|
|
};
|
|
|
|
programs.neomutt = {
|
|
enable = true;
|
|
vimKeys = false;
|
|
};
|
|
|
|
nixpkgs.overlays =
|
|
[ (self: super: { neomutt = pkgs.writeScriptBin "dummy-neomutt" ""; }) ];
|
|
|
|
nmt.script = ''
|
|
assertFileExists home-files/.config/neomutt/neomuttrc
|
|
assertFileExists home-files/.config/neomutt/hm@example.com
|
|
assertFileContent home-files/.config/neomutt/neomuttrc ${
|
|
./neomutt-with-named-mailboxes-expected.conf
|
|
}
|
|
assertFileContent home-files/.config/neomutt/hm@example.com ${
|
|
./hm-example.com-expected
|
|
}
|
|
'';
|
|
};
|
|
}
|