Merge pull request #50113 from ryantm/monit
nixos/monit: change type of 'config' option to lines
This commit is contained in:
commit
1d261945c7
@ -1,33 +1,30 @@
|
|||||||
# Monit system watcher
|
|
||||||
# http://mmonit.org/monit/
|
|
||||||
|
|
||||||
{config, pkgs, lib, ...}:
|
{config, pkgs, lib, ...}:
|
||||||
|
|
||||||
let inherit (lib) mkOption mkIf;
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.monit;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
options = {
|
options.services.monit = {
|
||||||
services.monit = {
|
|
||||||
enable = mkOption {
|
enable = mkEnableOption "Monit";
|
||||||
default = false;
|
|
||||||
description = ''
|
config = mkOption {
|
||||||
Whether to run Monit system watcher.
|
type = types.lines;
|
||||||
'';
|
default = "";
|
||||||
};
|
description = "monitrc content";
|
||||||
config = mkOption {
|
|
||||||
default = "";
|
|
||||||
description = "monitrc content";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.services.monit.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.monit ];
|
environment.systemPackages = [ pkgs.monit ];
|
||||||
|
|
||||||
environment.etc."monitrc" = {
|
environment.etc."monitrc" = {
|
||||||
text = config.services.monit.config;
|
text = cfg.config;
|
||||||
mode = "0400";
|
mode = "0400";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user