nixos/riemann: Add option configFiles

This commit is contained in:
Rickard Nilsson 2014-11-19 12:55:42 +01:00
parent aa9c9aecbe
commit 76f065a8de

View file

@ -11,11 +11,15 @@ let
cfg.extraClasspathEntries ++ [ "${riemann}/share/java/riemann.jar" ]
);
riemannConfig = concatStringsSep "\n" (
[cfg.config] ++ (map (f: ''(load-file "${f}")'') cfg.configFiles)
);
launcher = writeScriptBin "riemann" ''
#!/bin/sh
exec ${openjdk}/bin/java ${concatStringsSep "\n" cfg.extraJavaOpts} \
-cp ${classpath} \
riemann.bin ${writeText "riemann.config" cfg.config}
riemann.bin ${writeText "riemann-config.clj" riemannConfig}
'';
in {
@ -36,6 +40,16 @@ in {
Contents of the Riemann configuration file.
'';
};
configFiles = mkOption {
type = with types; listOf path;
default = [];
description = ''
Extra files containing Riemann configuration. These files will be
loaded at runtime by Riemann (with Clojure's
<literal>load-file</literal> function) at the end of the
configuration.
'';
};
extraClasspathEntries = mkOption {
type = with types; listOf str;
default = [];