mirror of
https://github.com/nix-community/home-manager
synced 2024-12-27 12:19:48 +01:00
neomutt: adding unmailboxes option
Adding unmailboxes option to neomutt, which adds the `unmailboxes` option it to every account.email with neomutt enabled. See https://www.mutt.org/doc/manual/#mailboxes for more.
This commit is contained in:
parent
36f873dfc8
commit
017b12de5b
4 changed files with 82 additions and 1 deletions
|
@ -296,7 +296,12 @@ let
|
|||
pkgs.writeText "signature.txt" account.signature.text
|
||||
}";
|
||||
in ''
|
||||
# Generated by Home Manager.
|
||||
# Generated by Home Manager.${
|
||||
optionalString cfg.unmailboxes ''
|
||||
|
||||
unmailboxes *
|
||||
''
|
||||
}
|
||||
set ssl_force_tls = ${
|
||||
lib.hm.booleans.yesNo (imap.tls.enable || imap.tls.useStartTls)
|
||||
}
|
||||
|
@ -397,6 +402,17 @@ in {
|
|||
default = true;
|
||||
};
|
||||
|
||||
unmailboxes = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Set `unmailboxes *` at the start of account configurations.
|
||||
It removes previous sidebar mailboxes when sourcing an account configuration.
|
||||
|
||||
See <http://www.mutt.org/doc/manual/#mailboxes> for more information.
|
||||
'';
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
|
|
|
@ -14,4 +14,5 @@
|
|||
neomutt-with-signature = ./neomutt-with-signature.nix;
|
||||
neomutt-with-signature-command = ./neomutt-with-signature-command.nix;
|
||||
neomutt-with-starttls = ./neomutt-with-starttls.nix;
|
||||
neomutt-unmailboxes = ./neomutt-unmailboxes.nix;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
# Generated by Home Manager.
|
||||
unmailboxes *
|
||||
|
||||
set ssl_force_tls = yes
|
||||
set certificate_file=/etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
# GPG section
|
||||
set crypt_autosign = no
|
||||
set crypt_opportunistic_encrypt = no
|
||||
set pgp_use_gpg_agent = yes
|
||||
set mbox_type = Maildir
|
||||
set sort = "threads"
|
||||
|
||||
# MTA section
|
||||
set sendmail='msmtpq --read-envelope-from --read-recipients'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# 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'
|
||||
|
||||
|
||||
# Extra configuration
|
||||
|
||||
|
||||
unset signature
|
30
tests/modules/programs/neomutt/neomutt-unmailboxes.nix
Normal file
30
tests/modules/programs/neomutt/neomutt-unmailboxes.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
imports = [ ../../accounts/email-test-accounts.nix ];
|
||||
|
||||
config = {
|
||||
accounts.email.accounts = {
|
||||
"hm@example.com" = {
|
||||
msmtp.enable = true;
|
||||
neomutt.enable = true;
|
||||
imap.port = 993;
|
||||
};
|
||||
};
|
||||
|
||||
programs.neomutt.enable = true;
|
||||
programs.neomutt.unmailboxes = true;
|
||||
|
||||
test.stubs.neomutt = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/neomutt/hm@example.com
|
||||
assertFileContent home-files/.config/neomutt/hm@example.com ${
|
||||
./hm-example.com-unmailboxes-expected.conf
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in a new issue