Merge pull request #50113 from ryantm/monit

nixos/monit: change type of 'config' option to lines
This commit is contained in:
Jörg Thalheim 2018-11-10 14:47:38 +00:00 committed by GitHub
commit 1d261945c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,33 +1,30 @@
# Monit system watcher
# http://mmonit.org/monit/
{config, pkgs, lib, ...}:
let inherit (lib) mkOption mkIf;
with lib;
let
cfg = config.services.monit;
in
{
options = {
services.monit = {
enable = mkOption {
default = false;
description = ''
Whether to run Monit system watcher.
'';
};
config = mkOption {
default = "";
description = "monitrc content";
};
options.services.monit = {
enable = mkEnableOption "Monit";
config = mkOption {
type = types.lines;
default = "";
description = "monitrc content";
};
};
config = mkIf config.services.monit.enable {
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.monit ];
environment.etc."monitrc" = {
text = config.services.monit.config;
text = cfg.config;
mode = "0400";
};