summary refs log tree commit diff
path: root/nixos/modules/system/boot/systemd.nix
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2022-03-01 06:54:12 +0900
committerDominique Martinet <asmadeus@codewreck.org>2022-04-01 07:09:26 +0900
commite92c05349c6053df22cf21eb9f424251ba2b114f (patch)
treec545f68e95ef9d37ad28a66e2eb174c9b9727182 /nixos/modules/system/boot/systemd.nix
parent3cc8ea28d1c20320b674d3d4131d02e4df8df5fa (diff)
downloadnixpkgs-e92c05349c6053df22cf21eb9f424251ba2b114f.tar
nixpkgs-e92c05349c6053df22cf21eb9f424251ba2b114f.tar.gz
nixpkgs-e92c05349c6053df22cf21eb9f424251ba2b114f.tar.bz2
nixpkgs-e92c05349c6053df22cf21eb9f424251ba2b114f.tar.lz
nixpkgs-e92c05349c6053df22cf21eb9f424251ba2b114f.tar.xz
nixpkgs-e92c05349c6053df22cf21eb9f424251ba2b114f.tar.zst
nixpkgs-e92c05349c6053df22cf21eb9f424251ba2b114f.zip
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
Diffstat (limited to 'nixos/modules/system/boot/systemd.nix')
-rw-r--r--nixos/modules/system/boot/systemd.nix18
1 files changed, 7 insertions, 11 deletions
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index 297a80d4681..f69c5d3d5a6 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -612,22 +612,18 @@ in
 
     boot.kernelParams = optional (!cfg.enableUnifiedCgroupHierarchy) "systemd.unified_cgroup_hierarchy=0";
 
-    services.logrotate.paths = {
+    services.logrotate.settings = {
       "/var/log/btmp" = mapAttrs (_: mkDefault) {
         frequency = "monthly";
-        keep = 1;
-        extraConfig = ''
-          create 0660 root ${config.users.groups.utmp.name}
-          minsize 1M
-        '';
+        rotate = 1;
+        create = "0660 root ${config.users.groups.utmp.name}";
+        minsize = "1M";
       };
       "/var/log/wtmp" = mapAttrs (_: mkDefault) {
         frequency = "monthly";
-        keep = 1;
-        extraConfig = ''
-          create 0664 root ${config.users.groups.utmp.name}
-          minsize 1M
-        '';
+        rotate = 1;
+        create = "0664 root ${config.users.groups.utmp.name}";
+        minsize = "1M";
       };
     };
   };