diff options
Diffstat (limited to 'hostnix')
| -rw-r--r-- | hostnix/elmo/system.nix | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/hostnix/elmo/system.nix b/hostnix/elmo/system.nix index 407ca42..23a6aa6 100644 --- a/hostnix/elmo/system.nix +++ b/hostnix/elmo/system.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ config, pkgs, ... }: { boot.loader.systemd-boot.enable = true; @@ -42,6 +42,17 @@ script = "${pkgs.pciutils}/bin/setpci -s 00:1f.0 0xa4.b=0"; }; + systemd.services.boot-email = { + description = "Boot email"; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + Type = "oneshot"; + }; + script = '' + echo -e "Subject: ${config.networking.fqdn} restarted\n\n$(date)" | /run/wrappers/bin/sendmail root + ''; + }; + # https://wiki.archlinux.org/index.php/Systemd/Timers#MAILTO systemd.services."status-email@" = { description = "Status email for %i"; @@ -50,7 +61,7 @@ }; scriptArgs = "%i"; script = '' - ${pkgs.mailutils}/bin/mail -s "$1 status" root <<EOF + /run/wrappers/bin/sendmail root <<EOF From: systemd <root> Subject: $1 status Content-Transfer-Encoding: 8bit |
