mirror of
https://github.com/nix-community/home-manager.git
synced 2025-04-07 17:45:06 +00:00
neomutt: remove empty lines
prettier + more readable
This commit is contained in:
parent
5ff90f09d1
commit
cb4ec90a4b
1 changed files with 41 additions and 42 deletions
|
@ -237,14 +237,16 @@ let
|
|||
else
|
||||
''named-mailboxes "${extra.name}" "${mailboxroot}/${extra.mailbox}"'')
|
||||
account.neomutt.extraMailboxes;
|
||||
in with account; ''
|
||||
# register account ${name}
|
||||
${optionalString account.neomutt.showDefaultMailbox
|
||||
''${mailboxes} "${mailroot}/${folders.inbox}"''}
|
||||
${extraMailboxes}
|
||||
${hookName} ${mailroot}/ " \
|
||||
source ${accountFilename account} "
|
||||
'';
|
||||
in with account;
|
||||
[ "## register account ${name}" ]
|
||||
++ optional account.neomutt.showDefaultMailbox
|
||||
''${mailboxes} "${mailroot}/${folders.inbox}"'' ++ [
|
||||
extraMailboxes
|
||||
''
|
||||
${hookName} ${mailroot}/ " \
|
||||
source ${accountFilename account} "
|
||||
''
|
||||
];
|
||||
|
||||
mraSection = account:
|
||||
with account;
|
||||
|
@ -454,43 +456,40 @@ in {
|
|||
# otherwise use the first neomutt account as primary.
|
||||
primary =
|
||||
head (filter (a: a.primary) neomuttAccounts ++ neomuttAccounts);
|
||||
in ''
|
||||
# Generated by Home Manager.
|
||||
set header_cache = "${config.xdg.cacheHome}/neomutt/headers/"
|
||||
set message_cachedir = "${config.xdg.cacheHome}/neomutt/messages/"
|
||||
set editor = "${cfg.editor}"
|
||||
set implicit_autoview = yes
|
||||
set crypt_use_gpgme = yes
|
||||
in concatStringsSep "\n" ([
|
||||
"# Generated by Home Manager."
|
||||
''set header_cache = "${config.xdg.cacheHome}/neomutt/headers/"''
|
||||
''set message_cachedir = "${config.xdg.cacheHome}/neomutt/messages/"''
|
||||
''set editor = "${cfg.editor}"''
|
||||
"set implicit_autoview = yes"
|
||||
"set crypt_use_gpgme = yes"
|
||||
"alternative_order text/enriched text/plain text"
|
||||
"set delete = yes"
|
||||
(optionalString cfg.vimKeys
|
||||
"source ${pkgs.neomutt}/share/doc/neomutt/vim-keys/vim-keys.rc")
|
||||
] ++ (lib.optionals (cfg.binds != [ ]) [
|
||||
''
|
||||
|
||||
alternative_order text/enriched text/plain text
|
||||
# Binds''
|
||||
bindSection
|
||||
]) ++ [
|
||||
''
|
||||
|
||||
set delete = yes
|
||||
|
||||
${optionalString cfg.vimKeys
|
||||
"source ${pkgs.neomutt}/share/doc/neomutt/vim-keys/vim-keys.rc"}
|
||||
|
||||
# Binds
|
||||
${bindSection}
|
||||
|
||||
# Macros
|
||||
${macroSection}
|
||||
|
||||
# Register accounts
|
||||
${
|
||||
optionalString (accountCommandNeeded) ''
|
||||
set account_command = '${accountCommand}/bin/account-command.sh'
|
||||
''
|
||||
}${concatMapStringsSep "\n" registerAccount neomuttAccounts}
|
||||
|
||||
${optionalString cfg.sourcePrimaryAccount ''
|
||||
# Macros''
|
||||
macroSection
|
||||
"# Register accounts"
|
||||
(optionalString (accountCommandNeeded) ''
|
||||
set account_command = '${accountCommand}/bin/account-command.sh'
|
||||
'')
|
||||
] ++ (lib.flatten (map registerAccount neomuttAccounts)) ++ [
|
||||
(optionalString cfg.sourcePrimaryAccount ''
|
||||
# Source primary account
|
||||
source ${accountFilename primary}''}
|
||||
|
||||
# Extra configuration
|
||||
${optionsStr cfg.settings}
|
||||
|
||||
${cfg.extraConfig}
|
||||
'';
|
||||
source ${accountFilename primary}
|
||||
'')
|
||||
"# Extra configuration"
|
||||
(optionsStr cfg.settings)
|
||||
cfg.extraConfig
|
||||
]);
|
||||
};
|
||||
|
||||
assertions = [{
|
||||
|
|
Loading…
Add table
Reference in a new issue