neomutt: make folder change when sourcing account optional

This adds an option for disabling setting the folder when sourcing
accounts in neomutt.
This commit is contained in:
Sumner Evans 2021-04-12 11:25:02 -06:00 committed by Robert Helgesson
parent cdc774f337
commit 225bf275ba
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
4 changed files with 70 additions and 3 deletions

View file

@ -124,9 +124,10 @@ let
genMaildirAccountConfig = account:
with account;
let
folderHook = mapAttrsToList setOption (genCommonFolderHooks account // {
folder = "'${account.maildir.absPath}'";
});
folderHook = mapAttrsToList setOption (genCommonFolderHooks account
// optionalAttrs cfg.changeFolderWhenSourcingAccount {
folder = "'${account.maildir.absPath}'";
});
in ''
${concatStringsSep "\n" folderHook}
'';
@ -266,6 +267,11 @@ in {
description = "Extra configuration appended to the end.";
};
changeFolderWhenSourcingAccount =
mkEnableOption "changing the folder when sourcing an account" // {
default = true;
};
extraConfig = mkOption {
type = types.lines;
default = "";