neomutt: add module

PR #1002
This commit is contained in:
Matthieu Coudron 2020-01-22 00:52:01 +01:00 committed by Robert Helgesson
parent d8d5f85ab7
commit fba87f8998
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
10 changed files with 477 additions and 0 deletions

View file

@ -0,0 +1,3 @@
{
neomutt-simple = ./neomutt.nix;
}

View file

@ -0,0 +1,37 @@
# Generated by Home Manager.
set ssl_force_tls = yes
set certificate_file=/etc/ssl/certs/ca-certificates.crt
# GPG section
set crypt_use_gpgme = yes
set crypt_autosign = no
set pgp_use_gpg_agent = yes
set mbox_type = Maildir
set sort = "threads"
# MTA section
set smtp_pass='`password-command`'
set smtp_url='smtps://home.manager@smtp.example.com'
# MRA section
set folder='/home/hm-user/Mail/hm@example.com'
set from='hm@example.com'
set postponed='+Drafts'
set realname='H. M. Test'
set record='+Sent'
set spoolfile='+Inbox'
set trash='+Trash'
color status cyan default
# Extra configuration
color status cyan default
# notmuch section
set nm_default_uri = "notmuch:///home/hm-user/Mail"
virtual-mailboxes "My INBOX" "notmuch://?query=tag:inbox"

View file

@ -0,0 +1,27 @@
# Generated by Home Manager.
set header_cache = "/home/hm-user/.cache/neomutt/headers/"
set message_cachedir = "/home/hm-user/.cache/neomutt/messages/"
set editor = "$EDITOR"
set implicit_autoview = yes
alternative_order text/enriched text/plain text
set delete = yes
# Binds
# Macros
# Extra configuration
# register account hm@example.com
mailboxes "/home/hm-user/Mail/hm@example.com/Inbox"
folder-hook /home/hm-user/Mail/hm@example.com/ " \
source /home/hm-user/.config/neomutt/hm@example.com "
source /home/hm-user/.config/neomutt/hm@example.com

View file

@ -0,0 +1,46 @@
{ config, lib, pkgs, ... }:
with lib;
{
imports = [ ../../accounts/email-test-accounts.nix ];
config = {
home.username = "hm-user";
home.homeDirectory = "/home/hm-user";
xdg.configHome = mkForce "/home/hm-user/.config";
xdg.cacheHome = mkForce "/home/hm-user/.cache";
accounts.email.accounts = {
"hm@example.com" = {
primary = true;
notmuch.enable = true;
neomutt = {
enable = true;
extraConfig = ''
color status cyan default
'';
};
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-expected.conf}
assertFileContent home-files/.config/neomutt/hm@example.com ${./hm-example.com-expected}
'';
};
}