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 = {
29 description = lib.mdDoc ''
30 Enable the riemann-dash dashboard daemon.
35 description = lib.mdDoc ''
36 Contents added to the end of the riemann-dash configuration file.
41 default = "/var/riemann-dash";
42 description = lib.mdDoc ''
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.rules = [
63 "d '${cfg.dataDir}' - riemanndash riemanndash - -"
66 systemd.services.riemann-dash = {
67 wantedBy = [ "multi-user.target" ];
68 wants = [ "riemann.service" ];
69 after = [ "riemann.service" ];
71 mkdir -p '${cfg.dataDir}/config'
75 ExecStart = "${launcher}/bin/riemann-dash";