From 54ddf2176bd782c88523d53e72fade36676ccd32 Mon Sep 17 00:00:00 2001 From: Jaka Hudoklin Date: Sat, 25 Apr 2015 14:39:24 +0200 Subject: [PATCH] nixos/rippled: new options, fixes --- nixos/modules/services/misc/rippled.nix | 32 +++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/misc/rippled.nix b/nixos/modules/services/misc/rippled.nix index 85a1ed8ae9e..03fcc003a40 100644 --- a/nixos/modules/services/misc/rippled.nix +++ b/nixos/modules/services/misc/rippled.nix @@ -12,7 +12,7 @@ let path=${db.path} ${optionalString (db.compression != null) ("compression=${b2i db.compression}") } ${optionalString (db.onlineDelete != null) ("online_delete=${toString db.onlineDelete}")} - ${optionalString (db.advisoryDelete != null) ("advisory_delete=${toString db.advisoryDelete}")} + ${optionalString (db.advisoryDelete != null) ("advisory_delete=${b2i db.advisoryDelete}")} ${db.extraOpts} ''; @@ -71,6 +71,13 @@ let [sntp_servers] ${concatStringsSep "\n" cfg.sntpServers} + ${optionalString cfg.statsd.enable '' + [insight] + server=statsd + address=${cfg.statsd.address} + prefix=${cfg.statsd.prefix} + ''} + [rpc_startup] { "command": "log_level", "severity": "${cfg.logLevel}" } '' + cfg.extraConfig; @@ -142,7 +149,6 @@ let default = null; type = types.nullOr types.path; }; - }; }; }; @@ -150,7 +156,7 @@ let dbOptions = { type = mkOption { description = "Rippled database type."; - type = types.enum ["rocksdb" "nudb" "sqlite"]; + type = types.enum ["rocksdb" "nudb" "sqlite" "hyperleveldb"]; default = "rocksdb"; }; @@ -317,7 +323,7 @@ in Path to the ripple database. ''; type = types.path; - default = "/var/lib/rippled/db"; + default = "/var/lib/rippled"; }; validationQuorum = mkOption { @@ -366,6 +372,22 @@ in default = "error"; }; + statsd = { + enable = mkEnableOption "Whether enable statsd monitoring for rippled"; + + address = mkOption { + description = "The UDP address and port of the listening StatsD server."; + default = "127.0.0.1:8125"; + type = types.str; + }; + + prefix = mkOption { + description = "A string prepended to each collected metric."; + default = ""; + type = types.str; + }; + }; + extraConfig = mkOption { default = ""; description = '' @@ -400,6 +422,8 @@ in serviceConfig = { ExecStart = "${cfg.package}/bin/rippled --fg --conf ${cfg.config}"; User = "rippled"; + Restart = "on-failure"; + LimitNOFILE=10000; }; };