diff --git a/configuration/rescue-cd.nix b/configuration/rescue-cd.nix
index b576caede2fe..6f1a8a739248 100644
--- a/configuration/rescue-cd.nix
+++ b/configuration/rescue-cd.nix
@@ -81,6 +81,13 @@ rec {
enable = false;
};
};
+
+ environment = {
+ extraPackages = pkgs: [
+ pkgs.vimDiet
+ ];
+ };
+
};
diff --git a/etc/default.nix b/etc/default.nix
index 414b4ccde722..d1946df6d91c 100644
--- a/etc/default.nix
+++ b/etc/default.nix
@@ -127,8 +127,20 @@ import ../helpers/make-etc.nix {
";
target = "nix.conf"; # will be symlinked from /nix/etc/nix/nix.conf in activate-configuration.sh.
}
+
]
+ # Configuration for ssmtp.
+ ++ (optional ["networking" "defaultMailServer" "directDelivery"] {
+ source = pkgs.writeText "ssmtp.conf" "
+mailhub=${config.get ["networking" "defaultMailServer" "hostName"]}
+UseTLS=${if config.get ["networking" "defaultMailServer" "useTLS"] then "YES" else "NO"}
+UseSTARTTLS=${if config.get ["networking" "defaultMailServer" "useSTARTTLS"] then "YES" else "NO"}
+#Debug=YES
+ ";
+ target = "ssmtp/ssmtp.conf";
+ })
+
# Configuration file for fontconfig used to locate
# (X11) client-rendered fonts.
++ (optional ["fonts" "enableFontConfig"] {
diff --git a/system/options.nix b/system/options.nix
index 7c5744e10933..432582d5bd97 100644
--- a/system/options.nix
+++ b/system/options.nix
@@ -236,10 +236,10 @@
}
{
- name = ["networking" "extraHosts"];
- default = "";
- example = "192.168.0.1 lanlocalhost";
- description = "Pasted verbatim into /etc/hosts.";
+ name = ["networking" "extraHosts"];
+ default = "";
+ example = "192.168.0.1 lanlocalhost";
+ description = "Pasted verbatim into /etc/hosts.";
}
{
@@ -322,7 +322,7 @@
description = "
If true, monitor Ethernet interfaces for
cables being plugged in or unplugged. When this occurs, the
- dhclient service is restarted to
+ dhclient service is restarted to
automatically obtain a new IP address. This is useful for
roaming users (laptops).
";
@@ -339,6 +339,56 @@
}
+ {
+ name = ["networking" "defaultMailServer" "directDelivery"];
+ default = false;
+ example = true;
+ description = "
+ Use the trivial Mail Transfer Agent (MTA)
+ ssmtp package to allow programs to send
+ e-mail. If you don't want to run a “real” MTA like
+ sendmail or postfix on
+ your machine, set this option to true, and
+ set the option
+ to the
+ host name of your preferred mail server.
+ ";
+ }
+
+
+ {
+ name = ["networking" "defaultMailServer" "hostName"];
+ example = "mail.example.org";
+ description = "
+ The host name of the default mail server to use to deliver
+ e-mail.
+ ";
+ }
+
+
+ {
+ name = ["networking" "defaultMailServer" "useTLS"];
+ default = false;
+ example = true;
+ description = "
+ Whether TLS should be used to connect to the default mail
+ server.
+ ";
+ }
+
+
+ {
+ name = ["networking" "defaultMailServer" "useSTARTTLS"];
+ default = false;
+ example = true;
+ description = "
+ Whether the STARTTLS should be used to connect to the default
+ mail server. (This is needed for TLS-capable mail servers
+ running on the default SMTP port 25.)
+ ";
+ }
+
+
{
name = ["fileSystems"];
default = [];
diff --git a/system/system.nix b/system/system.nix
index ab9527015e51..9a7399699d4c 100644
--- a/system/system.nix
+++ b/system/system.nix
@@ -221,7 +221,6 @@ rec {
pkgs.udev
pkgs.upstart
pkgs.utillinux
- pkgs.vimDiet
pkgs.wirelesstools
nix
nixosInstall
@@ -230,6 +229,7 @@ rec {
setuidWrapper
]
++ pkgs.lib.optional (config.get ["security" "sudo" "enable"]) pkgs.sudo
+ ++ pkgs.lib.optional (config.get ["networking" "defaultMailServer" "directDelivery"]) pkgs.ssmtp
++ pkgs.lib.concatLists (map (job: job.extraPath) upstartJobs.jobs)
++ (config.get ["environment" "extraPackages"]) pkgs
++ pkgs.lib.optional (config.get ["fonts" "enableFontDir"]) fontDir;