1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-25 11:19:47 +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:
Philipp Kühn 2024-02-29 08:35:16 +01:00 committed by Mikilio
parent cf47426205
commit 3cfa41e342
No known key found for this signature in database
GPG key ID: 5B2F1A890CF33F3F
4 changed files with 82 additions and 1 deletions

View file

@ -296,7 +296,12 @@ let
pkgs.writeText "signature.txt" account.signature.text pkgs.writeText "signature.txt" account.signature.text
}"; }";
in '' in ''
# Generated by Home Manager. # Generated by Home Manager.${
optionalString cfg.unmailboxes ''
unmailboxes *
''
}
set ssl_force_tls = ${ set ssl_force_tls = ${
lib.hm.booleans.yesNo (imap.tls.enable || imap.tls.useStartTls) lib.hm.booleans.yesNo (imap.tls.enable || imap.tls.useStartTls)
} }
@ -397,6 +402,17 @@ in {
default = true; 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 { extraConfig = mkOption {
type = types.lines; type = types.lines;
default = ""; default = "";

View file

@ -14,4 +14,5 @@
neomutt-with-signature = ./neomutt-with-signature.nix; neomutt-with-signature = ./neomutt-with-signature.nix;
neomutt-with-signature-command = ./neomutt-with-signature-command.nix; neomutt-with-signature-command = ./neomutt-with-signature-command.nix;
neomutt-with-starttls = ./neomutt-with-starttls.nix; neomutt-with-starttls = ./neomutt-with-starttls.nix;
neomutt-unmailboxes = ./neomutt-unmailboxes.nix;
} }

View file

@ -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

View 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
}
'';
};
}