about summary refs log tree commit diff
path: root/nixos/modules/services/monitoring/monit.nix
diff options
context:
space:
mode:
authorRyan Mulligan <ryan@ryantm.com>2018-03-28 14:45:57 -0700
committerRyan Mulligan <ryan@ryantm.com>2018-03-28 15:21:56 -0700
commit690fcc97ef69f6f6692c4be0a6085038a6369d3c (patch)
tree5cba59ce36b6f9c468514443d0809f55df641013 /nixos/modules/services/monitoring/monit.nix
parent4d5f7ce09f59862a636ef7aaaac7958ce2f12936 (diff)
downloadnixlib-690fcc97ef69f6f6692c4be0a6085038a6369d3c.tar
nixlib-690fcc97ef69f6f6692c4be0a6085038a6369d3c.tar.gz
nixlib-690fcc97ef69f6f6692c4be0a6085038a6369d3c.tar.bz2
nixlib-690fcc97ef69f6f6692c4be0a6085038a6369d3c.tar.lz
nixlib-690fcc97ef69f6f6692c4be0a6085038a6369d3c.tar.xz
nixlib-690fcc97ef69f6f6692c4be0a6085038a6369d3c.tar.zst
nixlib-690fcc97ef69f6f6692c4be0a6085038a6369d3c.zip
nixos/monit: restart if config changes
Diffstat (limited to 'nixos/modules/services/monitoring/monit.nix')
-rw-r--r--nixos/modules/services/monitoring/monit.nix16
1 files changed, 6 insertions, 10 deletions
diff --git a/nixos/modules/services/monitoring/monit.nix b/nixos/modules/services/monitoring/monit.nix
index 71f50cc0f19d..d48e5c550abb 100644
--- a/nixos/modules/services/monitoring/monit.nix
+++ b/nixos/modules/services/monitoring/monit.nix
@@ -26,16 +26,10 @@ in
 
     environment.systemPackages = [ pkgs.monit ];
 
-    environment.etc = [
-      {
-        source = pkgs.writeTextFile {
-          name = "monitrc";
-          text = config.services.monit.config;
-        };
-        target = "monitrc";
-        mode = "0400";
-      }
-    ];
+    environment.etc."monitrc" = {
+      text = config.services.monit.config;
+      mode = "0400";
+    };
 
     systemd.services.monit = {
       description = "Pro-active monitoring utility for unix systems";
@@ -48,6 +42,8 @@ in
         KillMode = "process";
         Restart = "always";
       };
+      restartTriggers = [ config.environment.etc."monitrc".source ];
     };
+
   };
 }