From 0184c8180f5cbb8e3a54a239b874fe849d3073cb Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sun, 14 Aug 2022 01:37:46 +0200 Subject: [PATCH] neomutt: add some options Superficially, allow source primary account by default and show default mailbox. --- modules/programs/neomutt-accounts.nix | 6 ++++++ modules/programs/neomutt.nix | 13 ++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/modules/programs/neomutt-accounts.nix b/modules/programs/neomutt-accounts.nix index a7ed7ec6..bdeda863 100644 --- a/modules/programs/neomutt-accounts.nix +++ b/modules/programs/neomutt-accounts.nix @@ -76,6 +76,12 @@ in { ''; }; + showDefaultMailbox = mkOption { + type = types.bool; + default = true; + description = "Show the default mailbox (INBOX)"; + }; + mailboxName = mkOption { type = types.nullOr types.str; default = null; diff --git a/modules/programs/neomutt.nix b/modules/programs/neomutt.nix index d338a580..069c4de8 100644 --- a/modules/programs/neomutt.nix +++ b/modules/programs/neomutt.nix @@ -235,7 +235,8 @@ let account.neomutt.extraMailboxes; in with account; '' # register account ${name} - ${mailboxes} "${mailroot}/${folders.inbox}" + ${optionalString account.neomutt.showDefaultMailbox + ''${mailboxes} "${mailroot}/${folders.inbox}"''} ${extraMailboxes} ${hookName} ${mailroot}/ " \ source ${accountFilename account} " @@ -402,6 +403,11 @@ in { default = true; }; + sourcePrimaryAccount = + mkEnableOption "source the primary account by default" // { + default = true; + }; + unmailboxes = mkOption { type = types.bool; default = false; @@ -467,8 +473,9 @@ in { '' }${concatMapStringsSep "\n" registerAccount neomuttAccounts} - # Source primary account - source ${accountFilename primary} + ${optionalString cfg.sourcePrimaryAccount '' + # Source primary account + source ${accountFilename primary}''} # Extra configuration ${optionsStr cfg.settings}