1 { config, pkgs, lib, ... }:
8 cfg = config.services.riemann-dash;
10 conf = writeText "config.rb" ''
11 riemann_base = "${cfg.dataDir}"
12 config.store[:ws_config] = "#{riemann_base}/config/config.json"
16 launcher = writeScriptBin "riemann-dash" ''
18 exec ${pkgs.riemann-dash}/bin/riemann-dash ${conf}
25 services.riemann-dash = {
30 Enable the riemann-dash dashboard daemon.
36 Contents added to the end of the riemann-dash configuration file.
41 default = "/var/riemann-dash";
43 Location of the riemann-base dir. The dashboard configuration file is
44 is stored to this directory. The directory is created automatically on
45 service start, and owner is set to the riemanndash user.
52 config = mkIf cfg.enable {
54 users.groups.riemanndash.gid = config.ids.gids.riemanndash;
56 users.users.riemanndash = {
57 description = "riemann-dash daemon user";
58 uid = config.ids.uids.riemanndash;
59 group = "riemanndash";
62 systemd.tmpfiles.settings."10-riemanndash".${cfg.dataDir}.d = {
64 group = "riemanndash";
67 systemd.services.riemann-dash = {
68 wantedBy = [ "multi-user.target" ];
69 wants = [ "riemann.service" ];
70 after = [ "riemann.service" ];
72 mkdir -p '${cfg.dataDir}/config'
76 ExecStart = "${launcher}/bin/riemann-dash";