mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 22:50:39 +00:00
neomutt: Add encryptByDefault support (#1882)
Adds support for encryptByDefault to the neomutt module using the crypt_opportunistic_encrypt option.
This commit is contained in:
parent
c12897e8e1
commit
be56b6f2c5
6 changed files with 69 additions and 0 deletions
|
@ -189,6 +189,7 @@ let
|
||||||
# GPG section
|
# GPG section
|
||||||
set crypt_use_gpgme = yes
|
set crypt_use_gpgme = yes
|
||||||
set crypt_autosign = ${yesno (gpg.signByDefault or false)}
|
set crypt_autosign = ${yesno (gpg.signByDefault or false)}
|
||||||
|
set crypt_opportunistic_encrypt = ${yesno (gpg.encryptByDefault or false)}
|
||||||
set pgp_use_gpg_agent = yes
|
set pgp_use_gpg_agent = yes
|
||||||
set mbox_type = ${if maildir != null then "Maildir" else "mbox"}
|
set mbox_type = ${if maildir != null then "Maildir" else "mbox"}
|
||||||
set sort = "${cfg.sort}"
|
set sort = "${cfg.sort}"
|
||||||
|
|
|
@ -6,4 +6,5 @@
|
||||||
neomutt-with-binds-with-warning = ./neomutt-with-binds-with-warning.nix;
|
neomutt-with-binds-with-warning = ./neomutt-with-binds-with-warning.nix;
|
||||||
neomutt-with-binds-invalid-settings =
|
neomutt-with-binds-invalid-settings =
|
||||||
./neomutt-with-binds-invalid-settings.nix;
|
./neomutt-with-binds-invalid-settings.nix;
|
||||||
|
neomutt-with-gpg = ./neomutt-with-gpg.nix;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ set certificate_file=/etc/ssl/certs/ca-certificates.crt
|
||||||
# GPG section
|
# GPG section
|
||||||
set crypt_use_gpgme = yes
|
set crypt_use_gpgme = yes
|
||||||
set crypt_autosign = no
|
set crypt_autosign = no
|
||||||
|
set crypt_opportunistic_encrypt = no
|
||||||
set pgp_use_gpg_agent = yes
|
set pgp_use_gpg_agent = yes
|
||||||
set mbox_type = Maildir
|
set mbox_type = Maildir
|
||||||
set sort = "threads"
|
set sort = "threads"
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
# 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 = yes
|
||||||
|
set crypt_opportunistic_encrypt = yes
|
||||||
|
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'
|
||||||
|
|
||||||
|
|
||||||
|
# Extra configuration
|
||||||
|
|
|
@ -5,6 +5,7 @@ set certificate_file=/etc/ssl/certs/ca-certificates.crt
|
||||||
# GPG section
|
# GPG section
|
||||||
set crypt_use_gpgme = yes
|
set crypt_use_gpgme = yes
|
||||||
set crypt_autosign = no
|
set crypt_autosign = no
|
||||||
|
set crypt_opportunistic_encrypt = no
|
||||||
set pgp_use_gpg_agent = yes
|
set pgp_use_gpg_agent = yes
|
||||||
set mbox_type = Maildir
|
set mbox_type = Maildir
|
||||||
set sort = "threads"
|
set sort = "threads"
|
||||||
|
|
33
tests/modules/programs/neomutt/neomutt-with-gpg.nix
Normal file
33
tests/modules/programs/neomutt/neomutt-with-gpg.nix
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
with lib; {
|
||||||
|
imports = [ ../../accounts/email-test-accounts.nix ];
|
||||||
|
|
||||||
|
config = {
|
||||||
|
accounts.email.accounts = {
|
||||||
|
"hm@example.com" = {
|
||||||
|
gpg = {
|
||||||
|
encryptByDefault = true;
|
||||||
|
signByDefault = true;
|
||||||
|
};
|
||||||
|
neomutt.enable = true;
|
||||||
|
imap.port = 993;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.neomutt.enable = true;
|
||||||
|
|
||||||
|
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-gpg-expected.conf
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue