accounts.email: add option to disable an account

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.
This commit is contained in:
Adam Dinwoodie 2025-08-05 11:04:49 +01:00 committed by Austin Horstman
parent 07b994baed
commit dbfcd3292d
22 changed files with 164 additions and 26 deletions

View file

@ -11,7 +11,9 @@ let
jsonFormat = pkgs.formats.json { };
astroidAccounts = lib.filterAttrs (n: v: v.astroid.enable) config.accounts.email.accounts;
astroidAccounts = lib.filterAttrs (
n: v: v.enable && v.astroid.enable
) config.accounts.email.accounts;
boolOpt = b: if b then "true" else "false";