summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2017-07-30 19:37:17 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2017-07-30 19:37:17 +0200
commiteaf585b8d3082c69a3659743ca0b685063321d98 (patch)
tree6182a8c980bf112751184a0fdfe61287d246b8b0
parent5c891e28bf02c00ca0762c873bab86db1b40cfcd (diff)
downloadnixos-eaf585b8d3082c69a3659743ca0b685063321d98.tar
nixos-eaf585b8d3082c69a3659743ca0b685063321d98.tar.gz
nixos-eaf585b8d3082c69a3659743ca0b685063321d98.tar.bz2
nixos-eaf585b8d3082c69a3659743ca0b685063321d98.tar.xz
nixos-eaf585b8d3082c69a3659743ca0b685063321d98.zip
-rw-r--r--custom/unit-status-mail.nix7
1 files changed, 4 insertions, 3 deletions
diff --git a/custom/unit-status-mail.nix b/custom/unit-status-mail.nix
index 4ad08667..58136724 100644
--- a/custom/unit-status-mail.nix
+++ b/custom/unit-status-mail.nix
@@ -4,6 +4,9 @@ with lib;
4 4
5let 5let
6 cfg = config.systemd.status-mail; 6 cfg = config.systemd.status-mail;
7
8 serviceCfg = traceValSeq (foldl singleServiceCfg {} cfg.onFailure);
9 singleServiceCfg = attrs: unitName: attrs // (setAttrByPath [unitName "onFailure"] ["unit-status-mail@%n.service"]);
7in { 10in {
8 options = { 11 options = {
9 systemd.status-mail = { 12 systemd.status-mail = {
@@ -26,9 +29,7 @@ in {
26 }; 29 };
27 30
28 config = mkIf (cfg.onFailure != []) { 31 config = mkIf (cfg.onFailure != []) {
29 systemd.services = let 32 systemd.services = config.systemd.services // serviceCfg;
30 singleServiceCfg = attrs: unitName: attrs // (setAttrByPath [unitName "onFailure"] ["unit-status-mail@%n.service"]);
31 in foldl singleServiceCfg {} cfg.onFailure;
32 33
33 systemd.services."unit-status-mail@" = { 34 systemd.services."unit-status-mail@" = {
34 serviceConfig = { 35 serviceConfig = {