Allow a user to disable an email account by setting
`accounts.email.accounts.<name>.enable = false`. This is useful if
someone wants to configure email accounts globally but only use them in
certain circumstances.
Everywhere email account configuration is used, check if the account is
enabled before checking any attributes of the account.
If neither neomutt.sendMailCommand nor passCmd are set, leave
configuration for sending emails unset. This will leave neomutt to
manage sending emails itself, which matches the existing description of
the `accounts.email.accounts.<name>.neomutt.sendMailCommand`
configuration option.
This also removes the assertion added in bd680a8c (neomutt: allow
default email sending behaviour, 2025-07-12), since it is now valid to
have neither passCmd nor neomutt.sendMailCommand on an account.
f there's an account under accounts.email.accounts with neomutt.enable set to true but neither passwordCommand nor neomutt.sendMailCommand set, then building the Neomutt rc file will fail. Ensure that failure has a useful error message, rather than a confusing type error.
While we're here, make the module code slightly less repetitious by just building the set of email accounts that have Neomutt enabled once, rather than multiple times in multiple contexts.
Reduce maintenance burden and increase efficiency by automatically
importing modules following a specific convention.
Co-authored-by: awwpotato <awwpotato@voidq.com>
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-06-22 23:58:37 -05:00
Renamed from modules/programs/neomutt.nix (Browse further)