nixdots/system/shared/services/logrotate.nix

29 lines
664 B
Nix
Raw Normal View History

2024-07-26 23:07:07 +00:00
{
pkgs,
lib,
...
}: {
2024-04-13 15:59:56 +00:00
services.logrotate.settings.header = {
# general
global = true;
dateext = true;
dateformat = "-%Y-%m-%d";
nomail = true;
missingok = true;
copytruncate = true;
# rotation frequency
priority = 1;
frequency = "weekly";
rotate = 7; # special value, means 7 days
minage = 7; # avoid rotating files that are less than 7 days old
# compression
compress = true; # compress logs to save space
compresscmd = "${lib.getExe' pkgs.zstd "zstd"}";
compressoptions = " -Xcompression-level 10";
compressext = "zst";
2024-04-13 16:10:14 +00:00
uncompresscmd = "${lib.getExe' pkgs.zstd "unzstd"}";
2024-04-13 15:59:56 +00:00
};
}