Merge pull request #74048 from ckauhaus/ssmtp-named-ssmtp
ssmtp: use services.ssmtp not networking.defaultMailServer
This commit is contained in:
commit
4e8c2f08b0
3 changed files with 10 additions and 10 deletions
|
@ -8,18 +8,16 @@
|
|||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.networking.defaultMailServer;
|
||||
cfg = config.services.ssmtp;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
options = {
|
||||
|
||||
networking.defaultMailServer = {
|
||||
services.ssmtp = {
|
||||
|
||||
directDelivery = mkOption {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
|
@ -29,7 +27,7 @@ in
|
|||
<command>sendmail</command> or <command>postfix</command> on
|
||||
your machine, set this option to <literal>true</literal>, and
|
||||
set the option
|
||||
<option>networking.defaultMailServer.hostName</option> to the
|
||||
<option>services.ssmtp.hostName</option> to the
|
||||
host name of your preferred mail server.
|
||||
'';
|
||||
};
|
||||
|
@ -129,9 +127,9 @@ in
|
|||
};
|
||||
|
||||
|
||||
config = mkIf cfg.directDelivery {
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
networking.defaultMailServer.authPassFile = mkIf (cfg.authPass != "")
|
||||
services.ssmtp.authPassFile = mkIf (cfg.authPass != "")
|
||||
(mkDefault (toString (pkgs.writeTextFile {
|
||||
name = "ssmtp-authpass";
|
||||
text = cfg.authPass;
|
||||
|
|
|
@ -11,6 +11,8 @@ with lib;
|
|||
(mkRenamedOptionModule [ "networking" "enableRTL8192cFirmware" ] [ "hardware" "enableRedistributableFirmware" ])
|
||||
(mkRenamedOptionModule [ "networking" "networkmanager" "useDnsmasq" ] [ "networking" "networkmanager" "dns" ])
|
||||
(mkRenamedOptionModule [ "networking" "connman" ] [ "services" "connman" ])
|
||||
(mkRenamedOptionModule [ "networking" "defaultMailServer" ] [ "services" "ssmtp" ])
|
||||
(mkRenamedOptionModule [ "services" "ssmtp" "directDelivery" ] [ "services" "ssmtp" "enable" ])
|
||||
(mkChangedOptionModule [ "services" "printing" "gutenprint" ] [ "services" "printing" "drivers" ]
|
||||
(config:
|
||||
let enabled = getAttrFromPath [ "services" "printing" "gutenprint" ] config;
|
||||
|
|
|
@ -9,8 +9,8 @@ import ./make-test.nix ({ lib, ... }:
|
|||
{
|
||||
services.mailcatcher.enable = true;
|
||||
|
||||
networking.defaultMailServer.directDelivery = true;
|
||||
networking.defaultMailServer.hostName = "localhost:1025";
|
||||
services.ssmtp.enable = true;
|
||||
services.ssmtp.hostName = "localhost:1025";
|
||||
|
||||
environment.systemPackages = [ pkgs.mailutils ];
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue