mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 21:01:34 +01:00
victorialogs: Init module
This commit is contained in:
parent
eb545d2c6c
commit
c8af87f3aa
2 changed files with 49 additions and 0 deletions
|
|
@ -52,6 +52,11 @@
|
||||||
domain = "grafana.${config.custom.services.tailscale.domain}";
|
domain = "grafana.${config.custom.services.tailscale.domain}";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
victorialogs = {
|
||||||
|
enable = true;
|
||||||
|
domain = "logs.${config.custom.services.tailscale.domain}";
|
||||||
|
};
|
||||||
|
|
||||||
caddy.virtualHosts = {
|
caddy.virtualHosts = {
|
||||||
gatus = {
|
gatus = {
|
||||||
inherit (config.custom.services.gatus) domain port;
|
inherit (config.custom.services.gatus) domain port;
|
||||||
|
|
@ -62,6 +67,9 @@
|
||||||
grafana = {
|
grafana = {
|
||||||
inherit (config.custom.services.grafana) domain port;
|
inherit (config.custom.services.grafana) domain port;
|
||||||
};
|
};
|
||||||
|
victorialogs = {
|
||||||
|
inherit (config.custom.services.victorialogs) domain port;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
41
modules/system/services/victorialogs.nix
Normal file
41
modules/system/services/victorialogs.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs-unstable,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.custom.services.victorialogs;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.custom.services.victorialogs = {
|
||||||
|
enable = lib.mkEnableOption "";
|
||||||
|
maxDiskSpaceUsage = lib.mkOption {
|
||||||
|
type = lib.types.nonEmptyStr;
|
||||||
|
default = "10GiB";
|
||||||
|
};
|
||||||
|
domain = lib.mkOption {
|
||||||
|
type = lib.types.nonEmptyStr;
|
||||||
|
default = "";
|
||||||
|
};
|
||||||
|
port = lib.mkOption {
|
||||||
|
type = lib.types.port;
|
||||||
|
default = 9428;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
meta = {
|
||||||
|
domains.list = [ cfg.domain ];
|
||||||
|
ports.list = [ cfg.port ];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.victorialogs = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs-unstable.victorialogs;
|
||||||
|
|
||||||
|
listenAddress = ":${builtins.toString cfg.port}";
|
||||||
|
extraOptions = [ "-retention.maxDiskSpaceUsageBytes=${cfg.maxDiskSpaceUsage}" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue