falkenstein: configure log retention

This commit is contained in:
Rouven Seifert 2024-03-23 00:32:12 +01:00
parent a8d2ace6ab
commit c776c72286
Signed by: rouven.seifert
GPG key ID: B95E8FE6B11C4D09
3 changed files with 61 additions and 0 deletions

View file

@ -5,6 +5,7 @@
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./modules/backup ./modules/backup
./modules/logging
./modules/dns ./modules/dns
./modules/fail2ban ./modules/fail2ban
./modules/mail ./modules/mail

View file

@ -0,0 +1,36 @@
{ 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
dateext
dateformat .%Y-%m-%d
extension log
}
"/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
}
'';
}

View file

@ -15,6 +15,30 @@ in
# freeimage is broken # freeimage is broken
withBackends = [ "libtiff" "libjpeg" "libpng" "librsvg" "libheif" ]; withBackends = [ "libtiff" "libjpeg" "libpng" "librsvg" "libheif" ];
}; };
# don't compile the bloat
rsyslog = prev.rsyslog.override {
withMysql = false;
withJemalloc = false;
withPostgres = false;
withUuid = false;
withCurl = false;
withDbi = false;
withNetSnmp = false;
withGnutls = false;
withGcrypt = false;
withLognorm = false;
withMaxminddb = false;
withOpenssl = false;
withRelp = false;
withKsi = false;
withLogging = false;
withHadoop = false;
withRdkafka = false;
withMongo = false;
withCzmq = false;
withRabbitmq = false;
withHiredis = false;
};
gnome-break-timer = callPackage ../pkgs/gnome-break-timer { }; gnome-break-timer = callPackage ../pkgs/gnome-break-timer { };
jmri = callPackage ../pkgs/jmri { }; jmri = callPackage ../pkgs/jmri { };