mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2024-11-16 05:43:10 +01:00
34 lines
684 B
Nix
34 lines
684 B
Nix
|
{ pkgs, ... }:
|
||
|
{
|
||
|
services.rsyslogd = {
|
||
|
enable = true;
|
||
|
defaultConfig = ''
|
||
|
:programname, isequal, "postfix" /var/log/postfix.log
|
||
|
|
||
|
auth.* -/var/log/auth.log
|
||
|
'';
|
||
|
};
|
||
|
services.logrotate.configFile = pkgs.writeText "logrotate.conf" ''
|
||
|
weekly
|
||
|
missingok
|
||
|
notifempty
|
||
|
rotate 4
|
||
|
"/var/log/postfix.log" {
|
||
|
compress
|
||
|
delaycompress
|
||
|
weekly
|
||
|
rotate 156
|
||
|
}
|
||
|
"/var/log/nginx/*.log" {
|
||
|
compress
|
||
|
delaycompress
|
||
|
weekly
|
||
|
postrotate
|
||
|
[ ! -f /var/run/nginx/nginx.pid ] || kill -USR1 `cat /var/run/nginx/nginx.pid`
|
||
|
endscript
|
||
|
rotate 26
|
||
|
su nginx nginx
|
||
|
}
|
||
|
'';
|
||
|
}
|