diff --git a/modules/programs/msmtp-accounts.nix b/modules/programs/msmtp-accounts.nix
index d4d4663f..1730232d 100644
--- a/modules/programs/msmtp-accounts.nix
+++ b/modules/programs/msmtp-accounts.nix
@@ -21,5 +21,16 @@ with lib;
primary account will be used.
'';
};
+
+ extraConfig = mkOption {
+ type = types.attrsOf types.str;
+ default = { };
+ example = { auth = "login"; };
+ description = ''
+ Extra configuration options to add to ~/.msmtprc.
+ See for
+ examples.
+ '';
+ };
};
}
diff --git a/modules/programs/msmtp.nix b/modules/programs/msmtp.nix
index 7f00bbb0..b19c4986 100644
--- a/modules/programs/msmtp.nix
+++ b/modules/programs/msmtp.nix
@@ -31,6 +31,7 @@ let
# msmtp requires the password to finish with a newline.
passwordeval = ''${pkgs.bash}/bin/bash -c "${toString passwordCommand}; echo"'';
}
+ // msmtp.extraConfig
)
++ optional primary "\naccount default : ${name}"
);