parent
d8d5f85ab7
commit
fba87f8998
10 changed files with 477 additions and 0 deletions
3
tests/modules/programs/neomutt/default.nix
Normal file
3
tests/modules/programs/neomutt/default.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
neomutt-simple = ./neomutt.nix;
|
||||
}
|
||||
37
tests/modules/programs/neomutt/hm-example.com-expected
Normal file
37
tests/modules/programs/neomutt/hm-example.com-expected
Normal 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"
|
||||
27
tests/modules/programs/neomutt/neomutt-expected.conf
Normal file
27
tests/modules/programs/neomutt/neomutt-expected.conf
Normal 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
|
||||
46
tests/modules/programs/neomutt/neomutt.nix
Normal file
46
tests/modules/programs/neomutt/neomutt.nix
Normal 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}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue