mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-21 21:09:00 +02:00
nixos/monit: install monit as system package, use default config file path
This commit is contained in:
parent
46b0bca808
commit
c6f513b56a
|
@ -17,20 +17,22 @@ in
|
||||||
};
|
};
|
||||||
config = mkOption {
|
config = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
description = "monit.conf content";
|
description = "monitrc content";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.services.monit.enable {
|
config = mkIf config.services.monit.enable {
|
||||||
|
|
||||||
|
environment.systemPackages = [ pkgs.monit ];
|
||||||
|
|
||||||
environment.etc = [
|
environment.etc = [
|
||||||
{
|
{
|
||||||
source = pkgs.writeTextFile {
|
source = pkgs.writeTextFile {
|
||||||
name = "monit.conf";
|
name = "monitrc";
|
||||||
text = config.services.monit.config;
|
text = config.services.monit.config;
|
||||||
};
|
};
|
||||||
target = "monit.conf";
|
target = "monitrc";
|
||||||
mode = "0400";
|
mode = "0400";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
@ -40,9 +42,9 @@ in
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${pkgs.monit}/bin/monit -I -c /etc/monit.conf";
|
ExecStart = "${pkgs.monit}/bin/monit -I -c /etc/monitrc";
|
||||||
ExecStop = "${pkgs.monit}/bin/monit -c /etc/monit.conf quit";
|
ExecStop = "${pkgs.monit}/bin/monit -c /etc/monitrc quit";
|
||||||
ExecReload = "${pkgs.monit}/bin/monit -c /etc/monit.conf reload";
|
ExecReload = "${pkgs.monit}/bin/monit -c /etc/monitrc reload";
|
||||||
KillMode = "process";
|
KillMode = "process";
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue