services/logrotate: Set up log rotation for NGINX and Asterisk

This commit is contained in:
kat witch 2021-05-27 23:12:28 +01:00
parent bc8dc605a9
commit 11b5f5bea2
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
2 changed files with 26 additions and 0 deletions

25
services/logrotate.nix Normal file
View file

@ -0,0 +1,25 @@
{ config, lib, ... }:
with lib;
{
services.logrotate = {
enable = true;
paths = {
nginx = mkIf config.services.nginx.enable {
path = "/var/log/nginx/*.log";
user = "nginx";
group = "nginx";
frequency = "weekly";
keep = 2;
};
asterisk = mkIf config.systemd.services.asterisk.enable {
path = "/var/log/asterisk/messages";
user = "asterisk";
group = "asterisk";
frequency = "daily";
keep = 2;
};
};
};
}