mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 17:49:07 +01:00
victorialogs: Remove module
This commit is contained in:
parent
9e79934cf2
commit
7a6b17fb36
4 changed files with 12 additions and 152 deletions
|
|
@ -37,15 +37,6 @@ in
|
|||
default = "https://${config.custom.web-services.victoriametrics.domain}";
|
||||
};
|
||||
};
|
||||
victorialogs = {
|
||||
enable = lib.mkEnableOption "" // {
|
||||
default = config.custom.web-services.victorialogs.enable;
|
||||
};
|
||||
url = lib.mkOption {
|
||||
type = lib.types.nonEmptyStr;
|
||||
default = "https://${config.custom.web-services.victorialogs.domain}";
|
||||
};
|
||||
};
|
||||
};
|
||||
dashboards = {
|
||||
nodeExporter.enable = lib.mkEnableOption "" // {
|
||||
|
|
@ -54,9 +45,6 @@ in
|
|||
victoriametrics.enable = lib.mkEnableOption "" // {
|
||||
default = config.custom.web-services.victoriametrics.enable;
|
||||
};
|
||||
victorialogs.enable = lib.mkEnableOption "" // {
|
||||
default = config.custom.web-services.victorialogs.enable;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -110,12 +98,6 @@ in
|
|||
inherit (cfg.datasources.victoriametrics) url;
|
||||
isDefault = false;
|
||||
})
|
||||
(lib.mkIf cfg.datasources.victorialogs.enable {
|
||||
name = "VictoriaLogs";
|
||||
type = "victoriametrics-logs-datasource";
|
||||
inherit (cfg.datasources.victorialogs) url;
|
||||
isDefault = false;
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
@ -126,7 +108,6 @@ in
|
|||
in
|
||||
[
|
||||
(lib.optional cfg.datasources.victoriametrics.enable plugins.victoriametrics-metrics-datasource)
|
||||
(lib.optional cfg.datasources.victorialogs.enable plugins.victoriametrics-logs-datasource)
|
||||
]
|
||||
|> lib.concatLists;
|
||||
};
|
||||
|
|
@ -157,22 +138,6 @@ in
|
|||
''
|
||||
);
|
||||
};
|
||||
# https://grafana.com/grafana/dashboards/22084-victorialogs-single-node/
|
||||
"grafana-dashboards/victorialogs-single-node-patched.json" = {
|
||||
enable = cfg.dashboards.victorialogs.enable;
|
||||
source =
|
||||
pkgs.fetchurl {
|
||||
name = "victorialogs-single-node.json";
|
||||
url = "https://grafana.com/api/dashboards/22084/revisions/8/download";
|
||||
hash = "sha256-/a3Rbp/6oyiLBnQtGupyFZW+fIHQfkyKRRTyfofxVTM=";
|
||||
}
|
||||
|> (
|
||||
src:
|
||||
pkgs.runCommand "victorialogs-single-node-patched.json" { buildInputs = [ pkgs.gnused ]; } ''
|
||||
sed 's/victoria-logs-//g' ${src} > $out
|
||||
''
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
custom.services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
|
|
|
|||
|
|
@ -1,44 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.custom.web-services.victorialogs;
|
||||
in
|
||||
{
|
||||
options.custom.web-services.victorialogs = {
|
||||
enable = lib.mkEnableOption "";
|
||||
domain = lib.mkOption {
|
||||
type = lib.types.nonEmptyStr;
|
||||
default = "";
|
||||
};
|
||||
port = lib.mkOption {
|
||||
type = lib.types.port;
|
||||
default = 9428;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
users = {
|
||||
users.victorialogs = {
|
||||
isSystemUser = true;
|
||||
group = config.users.groups.victoriametrics.name;
|
||||
};
|
||||
groups.victorialogs = { };
|
||||
};
|
||||
|
||||
systemd.services.victorialogs.serviceConfig = {
|
||||
DynamicUser = lib.mkForce false;
|
||||
User = config.users.users.victorialogs.name;
|
||||
Group = config.users.groups.victorialogs.name;
|
||||
};
|
||||
|
||||
services.victorialogs = {
|
||||
enable = true;
|
||||
listenAddress = "localhost:${toString cfg.port}";
|
||||
};
|
||||
|
||||
custom = {
|
||||
services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
|
||||
persistence.directories = [ "/var/lib/${config.services.victorialogs.stateDir}" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue