3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #44341 from shmish111/riemann-options

nixos/riemann: refactor config
This commit is contained in:
Silvan Mosberger 2018-09-07 16:41:59 +02:00 committed by GitHub
commit 00c6f85d18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,9 +17,9 @@ let
launcher = writeScriptBin "riemann" '' launcher = writeScriptBin "riemann" ''
#!/bin/sh #!/bin/sh
exec ${jdk}/bin/java ${concatStringsSep "\n" cfg.extraJavaOpts} \ exec ${jdk}/bin/java ${concatStringsSep " " cfg.extraJavaOpts} \
-cp ${classpath} \ -cp ${classpath} \
riemann.bin ${writeText "riemann-config.clj" riemannConfig} riemann.bin ${cfg.configFile}
''; '';
in { in {
@ -37,7 +37,8 @@ in {
config = mkOption { config = mkOption {
type = types.lines; type = types.lines;
description = '' description = ''
Contents of the Riemann configuration file. Contents of the Riemann configuration file. For more complicated
config you should use configFile.
''; '';
}; };
configFiles = mkOption { configFiles = mkOption {
@ -47,7 +48,15 @@ in {
Extra files containing Riemann configuration. These files will be Extra files containing Riemann configuration. These files will be
loaded at runtime by Riemann (with Clojure's loaded at runtime by Riemann (with Clojure's
<literal>load-file</literal> function) at the end of the <literal>load-file</literal> function) at the end of the
configuration. configuration if you use the config option, this is ignored if you
use configFile.
'';
};
configFile = mkOption {
type = types.str;
description = ''
A Riemann config file. Any files in the same directory as this file
will be added to the classpath by Riemann.
''; '';
}; };
extraClasspathEntries = mkOption { extraClasspathEntries = mkOption {
@ -77,6 +86,10 @@ in {
group = "riemann"; group = "riemann";
}; };
services.riemann.configFile = mkDefault (
writeText "riemann-config.clj" riemannConfig
);
systemd.services.riemann = { systemd.services.riemann = {
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
path = [ inetutils ]; path = [ inetutils ];
@ -84,6 +97,7 @@ in {
User = "riemann"; User = "riemann";
ExecStart = "${launcher}/bin/riemann"; ExecStart = "${launcher}/bin/riemann";
}; };
serviceConfig.LimitNOFILE = 65536;
}; };
}; };