git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/monit: install monit as system package, use default config file path
commitc6f513b56a30fe974ec9166c8e94c51c0ab6e097 authorRyan Mulligan <ryan@ryantm.com> dateWed 27 Sep 2017, 15:20 (9 years ago) parent46b0bca
1 file changed+8−6
nixos/modules/services/monitoring/monit.nix+8−6
nixos/modules/services/monitoring/monit.nix+8−6
@@ -17,20 +17,22 @@ in
1717 };
1818 config = mkOption {
1919 default = "";
20− description = "monit.conf content";
20+ description = "monitrc content";
2121 };
2222 };
2323 };
2424
2525 config = mkIf config.services.monit.enable {
2626
27+ environment.systemPackages = [ pkgs.monit ];
28+
2729 environment.etc = [
2830 {
2931 source = pkgs.writeTextFile {
30− name = "monit.conf";
32+ name = "monitrc";
3133 text = config.services.monit.config;
3234 };
33− target = "monit.conf";
35+ target = "monitrc";
3436 mode = "0400";
3537 }
3638 ];
@@ -40,9 +42,9 @@ in
4042 after = [ "network.target" ];
4143 wantedBy = [ "multi-user.target" ];
4244 serviceConfig = {
43− ExecStart = "${pkgs.monit}/bin/monit -I -c /etc/monit.conf";
44− ExecStop = "${pkgs.monit}/bin/monit -c /etc/monit.conf quit";
45− ExecReload = "${pkgs.monit}/bin/monit -c /etc/monit.conf reload";
45+ ExecStart = "${pkgs.monit}/bin/monit -I -c /etc/monitrc";
46+ ExecStop = "${pkgs.monit}/bin/monit -c /etc/monitrc quit";
47+ ExecReload = "${pkgs.monit}/bin/monit -c /etc/monitrc reload";
4648 KillMode = "process";
4749 Restart = "always";
4850 };