nixos/logrotate: convert to freeform

using freeform is the new standard way of using modules and should replace
extraConfig.
In particular, this will allow us to place a condition on mails
This commit is contained in:
Dominique Martinet
2022-03-01 06:54:12 +09:00
parent 3cc8ea28d1
commit e92c05349c
10 changed files with 297 additions and 100 deletions

View File

@@ -51,18 +51,14 @@ in
environment.etc."lxd-image-server/config.toml".source = format.generate "config.toml" cfg.settings;
services.logrotate.paths.lxd-image-server = {
path = "/var/log/lxd-image-server/lxd-image-server.log";
services.logrotate.settings.lxd-image-server = {
files = "/var/log/lxd-image-server/lxd-image-server.log";
frequency = "daily";
keep = 21;
extraConfig = ''
create 755 lxd-image-server ${cfg.group}
missingok
compress
delaycompress
copytruncate
notifempty
'';
rotate = 21;
create = "755 lxd-image-server ${cfg.group}";
compress = true;
delaycompress = true;
copytruncate = true;
};
systemd.tmpfiles.rules = [