diff --git a/nix/base-system/modules/victoria-logs.nix b/nix/base-system/modules/victoria-logs.nix index fc393d0..703abac 100644 --- a/nix/base-system/modules/victoria-logs.nix +++ b/nix/base-system/modules/victoria-logs.nix @@ -8,6 +8,14 @@ with lib; description = "Logging directory path for victoria-logs service"; default = "/Users/Zaphar/opt/victoria-logs"; }; + maxStorageSize = mkOption { + description = "Maximum storage size on disk [KB, MB, GB]"; + default = "200GiB"; + }; + retentionTime = mkOption { + description = "Timespan of logs to retain, Logs older than this will be dropped."; + default = "5d"; + }; listenAddr = mkOption { description = "Socket Address to listen on"; default = "127.0.0.1:9428"; @@ -41,6 +49,8 @@ with lib; "${pkgs.victoria-logs}/bin/victoria-logs" "-logNewStreams" "-storageDataPath=${config.services.victoria-logs.dataPath}/data" + "-retention.maxDiskSpaceUsageBytes=${config.services.victoria-logs.maxStorageSize}" + "-retentionPeriod=${config.services.victoria-logs.retentionTime}" "-httpListenAddr=${config.services.victoria-logs.listenAddr}" ]; KeepAlive = true;