mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 14:01:34 +01:00
victoriametrics: Init module
This commit is contained in:
parent
39edb229af
commit
aa0aed3ad2
2 changed files with 36 additions and 1 deletions
|
|
@ -33,7 +33,6 @@ in
|
|||
services.victorialogs = {
|
||||
enable = true;
|
||||
package = pkgs-unstable.victorialogs;
|
||||
|
||||
listenAddress = "localhost:${builtins.toString cfg.port}";
|
||||
extraOptions = [ "-retention.maxDiskSpaceUsageBytes=${cfg.maxDiskSpaceUsage}" ];
|
||||
};
|
||||
|
|
|
|||
36
modules/system/services/victoriametrics.nix
Normal file
36
modules/system/services/victoriametrics.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
config,
|
||||
pkgs-unstable,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.custom.services.victoriametrics;
|
||||
in
|
||||
{
|
||||
options.custom.services.victoriametrics = {
|
||||
enable = lib.mkEnableOption "";
|
||||
domain = lib.mkOption {
|
||||
type = lib.types.nonEmptyStr;
|
||||
default = "";
|
||||
};
|
||||
port = lib.mkOption {
|
||||
type = lib.types.port;
|
||||
default = 8428;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
meta = {
|
||||
domains.list = [ cfg.domain ];
|
||||
ports.tcp.list = [ cfg.port ];
|
||||
};
|
||||
|
||||
services.victoriametrics = {
|
||||
enable = true;
|
||||
package = pkgs-unstable.victoriametrics;
|
||||
listenAddress = "localhost:${builtins.toString cfg.port}";
|
||||
extraOptions = [ "-selfScrapeInterval=10s" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue