aboutsummaryrefslogtreecommitdiffstats
path: root/modules/communication/neomutt/account
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar@gmail.com>2026-09-24 03:42:34 +0530
committerArpit Chakladar <arpitchakladar@gmail.com>2026-09-24 03:42:34 +0530
commit44b8624d201e70c8418ada5db3c46e9ba130ea30 (patch)
treeab960997bf8831d294dd84838523b358b7012ac5 /modules/communication/neomutt/account
parent30f8fea050f3242f0e6a2072779e706b5c8ceaf1 (diff)
downloadhome-manager-config-44b8624d201e70c8418ada5db3c46e9ba130ea30.tar.gz
home-manager-config-44b8624d201e70c8418ada5db3c46e9ba130ea30.zip
refactor(naming): use kebab-case option names and consistent gopass secret naming
Diffstat (limited to 'modules/communication/neomutt/account')
-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
4 files changed, 27 insertions, 25 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"