nixos/services.grafana_reporter: remove with lib;
This commit is contained in:
parent
f1019c7adb
commit
8f9336460b
@ -1,53 +1,50 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.grafana_reporter;
|
||||
|
||||
in {
|
||||
options.services.grafana_reporter = {
|
||||
enable = mkEnableOption "grafana_reporter";
|
||||
enable = lib.mkEnableOption "grafana_reporter";
|
||||
|
||||
grafana = {
|
||||
protocol = mkOption {
|
||||
protocol = lib.mkOption {
|
||||
description = "Grafana protocol.";
|
||||
default = "http";
|
||||
type = types.enum ["http" "https"];
|
||||
type = lib.types.enum ["http" "https"];
|
||||
};
|
||||
addr = mkOption {
|
||||
addr = lib.mkOption {
|
||||
description = "Grafana address.";
|
||||
default = "127.0.0.1";
|
||||
type = types.str;
|
||||
type = lib.types.str;
|
||||
};
|
||||
port = mkOption {
|
||||
port = lib.mkOption {
|
||||
description = "Grafana port.";
|
||||
default = 3000;
|
||||
type = types.port;
|
||||
type = lib.types.port;
|
||||
};
|
||||
|
||||
};
|
||||
addr = mkOption {
|
||||
addr = lib.mkOption {
|
||||
description = "Listening address.";
|
||||
default = "127.0.0.1";
|
||||
type = types.str;
|
||||
type = lib.types.str;
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
port = lib.mkOption {
|
||||
description = "Listening port.";
|
||||
default = 8686;
|
||||
type = types.port;
|
||||
type = lib.types.port;
|
||||
};
|
||||
|
||||
templateDir = mkOption {
|
||||
templateDir = lib.mkOption {
|
||||
description = "Optional template directory to use custom tex templates";
|
||||
default = pkgs.grafana_reporter;
|
||||
defaultText = literalExpression "pkgs.grafana_reporter";
|
||||
type = types.either types.str types.path;
|
||||
defaultText = lib.literalExpression "pkgs.grafana_reporter";
|
||||
type = lib.types.either lib.types.str lib.types.path;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
systemd.services.grafana_reporter = {
|
||||
description = "Grafana Reporter Service Daemon";
|
||||
wantedBy = ["multi-user.target"];
|
||||
|
Loading…
Reference in New Issue
Block a user