mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 22:11:33 +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 = {
|
services.victorialogs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs-unstable.victorialogs;
|
package = pkgs-unstable.victorialogs;
|
||||||
|
|
||||||
listenAddress = "localhost:${builtins.toString cfg.port}";
|
listenAddress = "localhost:${builtins.toString cfg.port}";
|
||||||
extraOptions = [ "-retention.maxDiskSpaceUsageBytes=${cfg.maxDiskSpaceUsage}" ];
|
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