summary refs log tree commit diff
path: root/nixos/modules/system
diff options
context:
space:
mode:
authorJanne Heß <janne@hess.ooo>2022-02-23 11:24:17 +0100
committerGitHub <noreply@github.com>2022-02-23 11:24:17 +0100
commite5823f77b3c8c4058bcea9634156769635f8b61e (patch)
tree5797cb6c02cd88b22a644e37443f1c4635ac120d /nixos/modules/system
parent14780ccf6a68cd4178c21e0a3dfed63ddd9b020a (diff)
parenta05f1c9f9357d3c3c39b99a5aa020399ee28bb99 (diff)
downloadnixpkgs-e5823f77b3c8c4058bcea9634156769635f8b61e.tar
nixpkgs-e5823f77b3c8c4058bcea9634156769635f8b61e.tar.gz
nixpkgs-e5823f77b3c8c4058bcea9634156769635f8b61e.tar.bz2
nixpkgs-e5823f77b3c8c4058bcea9634156769635f8b61e.tar.lz
nixpkgs-e5823f77b3c8c4058bcea9634156769635f8b61e.tar.xz
nixpkgs-e5823f77b3c8c4058bcea9634156769635f8b61e.tar.zst
nixpkgs-e5823f77b3c8c4058bcea9634156769635f8b61e.zip
Merge pull request #159187 from martinetd/logrotate
logrotate service enhancements
Diffstat (limited to 'nixos/modules/system')
-rw-r--r--nixos/modules/system/boot/systemd.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index 1f2dd618698..441faa03af0 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -1217,6 +1217,23 @@ in
     boot.kernel.sysctl."kernel.pid_max" = mkIf pkgs.stdenv.is64bit (lib.mkDefault 4194304);
 
     boot.kernelParams = optional (!cfg.enableUnifiedCgroupHierarchy) "systemd.unified_cgroup_hierarchy=0";
+
+    services.logrotate.paths = {
+      "/var/log/btmp" = mapAttrs (_: mkDefault) {
+        frequency = "monthly";
+        keep = 1;
+        extraConfig = ''
+          create 0660 root ${config.users.groups.utmp.name}
+        '';
+      };
+      "/var/log/wtmp" = mapAttrs (_: mkDefault) {
+        frequency = "monthly";
+        keep = 1;
+        extraConfig = ''
+          create 0664 root ${config.users.groups.utmp.name}
+        '';
+      };
+    };
   };
 
   # FIXME: Remove these eventually.