aboutsummaryrefslogtreecommitdiffstats
path: root/modules/communication/neomutt
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar@gmail.com>2026-09-24 04:02:19 +0530
committerArpit Chakladar <arpitchakladar@gmail.com>2026-09-24 04:02:19 +0530
commit5ea8c30b7b82d4c1e7164541892066b1f24f7d22 (patch)
treead9b994cc5415f63bae1f2342f520756d43c67ce /modules/communication/neomutt
parentad96214c9ab94bce925000a6059e3c68e2ff6a22 (diff)
parent748669e19daa3afc8f0cfe10eedc19ae9766ed2c (diff)
downloadhome-manager-config-5ea8c30b7b82d4c1e7164541892066b1f24f7d22.tar.gz
home-manager-config-5ea8c30b7b82d4c1e7164541892066b1f24f7d22.zip
Merge branch 'massive-refactoring'
Diffstat (limited to 'modules/communication/neomutt')
-rw-r--r--modules/communication/neomutt/account/assertions.nix4
-rw-r--r--modules/communication/neomutt/account/default.nix26
-rw-r--r--modules/communication/neomutt/account/flavors/gmail/default.nix2
-rw-r--r--modules/communication/neomutt/account/options.nix20
-rw-r--r--modules/communication/neomutt/default.nix10
5 files changed, 34 insertions, 28 deletions
diff --git a/modules/communication/neomutt/account/assertions.nix b/modules/communication/neomutt/account/assertions.nix
index c19ab72..5c30311 100644
--- a/modules/communication/neomutt/account/assertions.nix
+++ b/modules/communication/neomutt/account/assertions.nix
@@ -5,12 +5,12 @@
{
assertion =
!config.communication.neomutt.enable
- || !lib.any (account: account.enable && account.passwordGopassSecret != null) (
+ || !lib.any (account: account.enable && account.password-gopass-secret != null) (
lib.attrValues config.communication.neomutt.accounts
)
|| config.security.gopass.enable;
message = ''
- An enabled communication.neomutt account uses passwordGopassSecret but security.gopass.enable is not set.
+ An enabled communication.neomutt account uses password-gopass-secret but security.gopass.enable is not set.
Enable security.gopass to provide the account password command.
'';
}
diff --git a/modules/communication/neomutt/account/default.nix b/modules/communication/neomutt/account/default.nix
index e2d92eb..61256e1 100644
--- a/modules/communication/neomutt/account/default.nix
+++ b/modules/communication/neomutt/account/default.nix
@@ -21,17 +21,19 @@
config = lib.mkIf config.communication.neomutt.enable {
accounts.email.accounts = lib.mapAttrs (accountName: accountInformation: {
- inherit (accountInformation) realName address primary;
+ inherit (accountInformation) address primary;
+
+ realName = accountInformation.real-name;
userName =
- if accountInformation.userName != null then
- accountInformation.userName
+ if accountInformation.username != null then
+ accountInformation.username
else
accountInformation.address;
passwordCommand =
- if accountInformation.passwordGopassSecret != null then
- "${lib.getExe config.security.gopass.package} -o ${accountInformation.passwordGopassSecret}"
+ if accountInformation.password-gopass-secret != null then
+ "${lib.getExe config.security.gopass.package} -o ${accountInformation.password-gopass-secret}"
else
null;
@@ -50,7 +52,7 @@
neomutt = {
enable = true;
- mailboxType = accountInformation.neomutt.mailboxType;
+ mailboxType = accountInformation.neomutt.mailbox-type;
extraConfig = accountInformation.neomutt.extraConfig;
};
@@ -71,7 +73,7 @@
enable = true;
neomutt = {
enable = true;
- virtualMailboxes = accountInformation.notmuch.neomutt.virtualMailboxes;
+ virtualMailboxes = accountInformation.notmuch.neomutt.virtual-mailboxes;
};
};
@@ -80,7 +82,7 @@
port = accountInformation.imap.port;
tls = {
enable = accountInformation.imap.tls.enable;
- useStartTls = accountInformation.imap.tls.useStartTls;
+ useStartTls = accountInformation.imap.tls.use-start-tls;
};
};
@@ -89,14 +91,14 @@
port = accountInformation.smtp.port;
tls = {
enable = accountInformation.smtp.tls.enable;
- useStartTls = accountInformation.smtp.tls.useStartTls;
+ useStartTls = accountInformation.smtp.tls.use-start-tls;
};
};
gpg = lib.optionalAttrs (accountInformation.gpg.key != null) {
key = accountInformation.gpg.key;
- signByDefault = accountInformation.gpg.signByDefault;
- encryptByDefault = accountInformation.gpg.encryptByDefault;
+ signByDefault = accountInformation.gpg.sign-by-default;
+ encryptByDefault = accountInformation.gpg.encrypt-by-default;
};
signature =
@@ -105,7 +107,7 @@
{
text = accountInformation.signature.text;
command = accountInformation.signature.command;
- showSignature = accountInformation.signature.showSignature;
+ showSignature = accountInformation.signature.show-signature;
};
}) (lib.filterAttrs (n: a: a.enable) config.communication.neomutt.accounts);
};
diff --git a/modules/communication/neomutt/account/flavors/gmail/default.nix b/modules/communication/neomutt/account/flavors/gmail/default.nix
index 66d7db3..5b3c098 100644
--- a/modules/communication/neomutt/account/flavors/gmail/default.nix
+++ b/modules/communication/neomutt/account/flavors/gmail/default.nix
@@ -32,7 +32,7 @@
neomutt.extraConfig = lib.mkBefore (builtins.readFile ./.muttrc);
- notmuch.neomutt.virtualMailboxes = lib.mkDefault [
+ notmuch.neomutt.virtual-mailboxes = lib.mkDefault [
{
name = "All Mail";
query = "folder:${name}/Inbox or folder:\"${name}/[Gmail]/Sent Mail\"";
diff --git a/modules/communication/neomutt/account/options.nix b/modules/communication/neomutt/account/options.nix
index 45e6744..676f8b0 100644
--- a/modules/communication/neomutt/account/options.nix
+++ b/modules/communication/neomutt/account/options.nix
@@ -6,7 +6,7 @@
default = true;
};
- realName = lib.mkOption {
+ real-name = lib.mkOption {
type = lib.types.str;
description = "Name displayed when sending mails.";
};
@@ -16,13 +16,13 @@
description = "Email address of this account.";
};
- userName = lib.mkOption {
+ username = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "Server username. Defaults to address if null.";
};
- passwordGopassSecret = lib.mkOption {
+ password-gopass-secret = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "Gopass secret path (e.g. mail/user@gmail.com). Constructs passwordCommand automatically.";
@@ -81,7 +81,7 @@
};
neomutt = {
- mailboxType = lib.mkOption {
+ mailbox-type = lib.mkOption {
type = lib.types.enum [
"maildir"
"imap"
@@ -178,7 +178,7 @@
notmuch = {
neomutt = {
- virtualMailboxes = lib.mkOption {
+ virtual-mailboxes = lib.mkOption {
type = lib.types.listOf (
lib.types.submodule {
options = {
@@ -237,7 +237,7 @@
description = "Enable TLS.";
};
- useStartTls = lib.mkOption {
+ use-start-tls = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Use STARTTLS.";
@@ -265,7 +265,7 @@
description = "Enable TLS.";
};
- useStartTls = lib.mkOption {
+ use-start-tls = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Use STARTTLS.";
@@ -280,13 +280,13 @@
description = "GPG key to use.";
};
- signByDefault = lib.mkOption {
+ sign-by-default = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Sign messages by default.";
};
- encryptByDefault = lib.mkOption {
+ encrypt-by-default = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Encrypt messages by default.";
@@ -306,7 +306,7 @@
description = "Command that generates a signature.";
};
- showSignature = lib.mkOption {
+ show-signature = lib.mkOption {
type = lib.types.nullOr (
lib.types.enum [
"append"
diff --git a/modules/communication/neomutt/default.nix b/modules/communication/neomutt/default.nix
index 018555f..e091a7d 100644
--- a/modules/communication/neomutt/default.nix
+++ b/modules/communication/neomutt/default.nix
@@ -6,6 +6,8 @@
...
}:
let
+ cfg = config.communication.neomutt;
+
neomuttSyncScript = pkgs.writeShellApplication {
name = "neomutt-sync";
runtimeInputs = [
@@ -61,13 +63,15 @@ in
};
config = lib.mkMerge [
- (lib.mkIf config.communication.neomutt.enable {
+ (lib.mkIf cfg.enable {
accounts.email.maildirBasePath = "${config.home.homeDirectory}/.local/share/mail";
home.sessionVariables.MAILDIR = config.accounts.email.maildirBasePath;
xdg.configFile."neomutt/mailcap".text =
builtins.replaceStrings [ "@@HTML_VIEWER@@" ] [ (lib.getExe config.web.chawan.package) ]
(builtins.readFile ./mailcap);
+ home.file.".local/share/icons/hicolor/scalable/apps/neomutt.svg".source =
+ config.lib.file.mkOutOfStoreSymlink "${config.programs.neomutt.package}/share/neomutt/logo/neomutt.svg";
programs.neomutt = {
enable = true;
package = pkgs.symlinkJoin {
@@ -93,11 +97,11 @@ in
);
};
})
- (lib.mkIf (config.communication.neomutt.enable && config.terminal.kitty.enable) {
+ (lib.mkIf (cfg.enable && config.terminal.kitty.enable) {
xdg.desktopEntries."neomutt" = {
name = "NeoMutt";
exec = "${lib.getExe config.terminal.kitty.package} --class neomutt -e ${lib.getExe config.programs.neomutt.package}";
- icon = "${config.programs.neomutt.package}/share/neomutt/logo/neomutt.svg";
+ icon = "neomutt";
categories = [
"Network"
"Email"