From fb9bf032fb2e68456f8653a15909038f87700a93 Mon Sep 17 00:00:00 2001 From: Rien Date: Sat, 27 Feb 2021 21:41:16 +0100 Subject: [PATCH] alot: set primary email first (#1826) Alot uses the first email in the config as primary email. Because the order in which the email.accounts were sorted was alphabetical, the account set to `primary = true` was not put first in the alot config and thus not considered as primary email for alot. This was fixed by sorting the email accounts again such that accounts with `primary = true` come first. --- modules/programs/alot.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/programs/alot.nix b/modules/programs/alot.nix index e907cd3e0..b3abf1f7d 100644 --- a/modules/programs/alot.nix +++ b/modules/programs/alot.nix @@ -7,9 +7,12 @@ let cfg = config.programs.alot; - alotAccounts = + enabledAccounts = filter (a: a.notmuch.enable) (attrValues config.accounts.email.accounts); + # sorted: primary first + alotAccounts = sort (a: b: !(a.primary -> b.primary)) enabledAccounts; + boolStr = v: if v then "True" else "False"; mkKeyValue = key: value: