mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2025-01-18 17:11:39 +01:00
falkenstein: configure log retention
This commit is contained in:
parent
a8d2ace6ab
commit
c776c72286
3 changed files with 61 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
|||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
./modules/backup
|
||||
./modules/logging
|
||||
./modules/dns
|
||||
./modules/fail2ban
|
||||
./modules/mail
|
||||
|
|
36
hosts/falkenstein/modules/logging/default.nix
Normal file
36
hosts/falkenstein/modules/logging/default.nix
Normal 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
|
||||
}
|
||||
'';
|
||||
}
|
|
@ -15,6 +15,30 @@ in
|
|||
# freeimage is broken
|
||||
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 { };
|
||||
jmri = callPackage ../pkgs/jmri { };
|
||||
|
|
Loading…
Reference in a new issue