git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #44341 from shmish111/riemann-options

nixos/riemann: refactor config

commit00c6f85d18f12552437618e455feab1938215699 authorSilvan Mosberger <infinisil@icloud.com> dateFri 7 Sep 2018, 16:41 (8 years ago) parent4ae70b71d497bb
1 file changed+18−4
nixos/modules/services/monitoring/riemann.nix+18−4
nixos/modules/services/monitoring/riemann.nix+18−4
@@ -17,9 +17,9 @@ let
1717
1818 launcher = writeScriptBin "riemann" ''
1919 #!/bin/sh
20− exec ${jdk}/bin/java ${concatStringsSep "\n" cfg.extraJavaOpts} \
20+ exec ${jdk}/bin/java ${concatStringsSep " " cfg.extraJavaOpts} \
2121 -cp ${classpath} \
22− riemann.bin ${writeText "riemann-config.clj" riemannConfig}
22+ riemann.bin ${cfg.configFile}
2323 '';
2424
2525in {
@@ -37,7 +37,8 @@ in {
3737 config = mkOption {
3838 type = types.lines;
3939 description = ''
40− Contents of the Riemann configuration file.
40+ Contents of the Riemann configuration file. For more complicated
41+ config you should use configFile.
4142 '';
4243 };
4344 configFiles = mkOption {
@@ -47,7 +48,15 @@ in {
4748 Extra files containing Riemann configuration. These files will be
4849 loaded at runtime by Riemann (with Clojure's
4950 <literal>load-file</literal> function) at the end of the
50− configuration.
51+ configuration if you use the config option, this is ignored if you
52+ use configFile.
53+ '';
54+ };
55+ configFile = mkOption {
56+ type = types.str;
57+ description = ''
58+ A Riemann config file. Any files in the same directory as this file
59+ will be added to the classpath by Riemann.
5160 '';
5261 };
5362 extraClasspathEntries = mkOption {
@@ -77,6 +86,10 @@ in {
7786 group = "riemann";
7887 };
7988
89+ services.riemann.configFile = mkDefault (
90+ writeText "riemann-config.clj" riemannConfig
91+ );
92+
8093 systemd.services.riemann = {
8194 wantedBy = [ "multi-user.target" ];
8295 path = [ inetutils ];
@@ -84,6 +97,7 @@ in {
8497 User = "riemann";
8598 ExecStart = "${launcher}/bin/riemann";
8699 };
100+ serviceConfig.LimitNOFILE = 65536;
87101 };
88102
89103 };