nixos/services.riemann-dash: remove with lib;
This commit is contained in:
parent
4f47314003
commit
9f025e3df5
@ -1,19 +1,15 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with pkgs;
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.riemann-dash;
|
||||
|
||||
conf = writeText "config.rb" ''
|
||||
conf = pkgs.writeText "config.rb" ''
|
||||
riemann_base = "${cfg.dataDir}"
|
||||
config.store[:ws_config] = "#{riemann_base}/config/config.json"
|
||||
${cfg.config}
|
||||
'';
|
||||
|
||||
launcher = writeScriptBin "riemann-dash" ''
|
||||
launcher = pkgs.writeScriptBin "riemann-dash" ''
|
||||
#!/bin/sh
|
||||
exec ${pkgs.riemann-dash}/bin/riemann-dash ${conf}
|
||||
'';
|
||||
@ -23,21 +19,21 @@ in {
|
||||
options = {
|
||||
|
||||
services.riemann-dash = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Enable the riemann-dash dashboard daemon.
|
||||
'';
|
||||
};
|
||||
config = mkOption {
|
||||
type = types.lines;
|
||||
config = lib.mkOption {
|
||||
type = lib.types.lines;
|
||||
description = ''
|
||||
Contents added to the end of the riemann-dash configuration file.
|
||||
'';
|
||||
};
|
||||
dataDir = mkOption {
|
||||
type = types.str;
|
||||
dataDir = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/var/riemann-dash";
|
||||
description = ''
|
||||
Location of the riemann-base dir. The dashboard configuration file is
|
||||
@ -49,7 +45,7 @@ in {
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
users.groups.riemanndash.gid = config.ids.gids.riemanndash;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user