From d42b74b1e9e74789220ac654bc152ee51529fa88 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 28 Jun 2023 14:01:48 +0800 Subject: [PATCH] profiles/server: update journald log retention Instead of using a service to force it out, we're using the appropriate journald settings instead. --- modules/nixos/profiles/server.nix | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/modules/nixos/profiles/server.nix b/modules/nixos/profiles/server.nix index 5a2a854c..056a019a 100644 --- a/modules/nixos/profiles/server.nix +++ b/modules/nixos/profiles/server.nix @@ -161,22 +161,10 @@ in dates = [ "weekly" ]; }; - # Journals cleanup every week. - systemd.services.cleanup-logs = { - description = "Weekly log cleanup"; - documentation = [ "man:journalctl(1)" ]; - serviceConfig.ExecStart = "${pkgs.systemd}/bin/journalctl --vacuum-time=30d"; - }; - - systemd.timers.clean-log = { - description = "Weekly log cleanup"; - documentation = [ "man:journalctl(1)" ]; - wantedBy = [ "multi-user.target" ]; - timerConfig = { - OnCalendar = "monthly"; - Persistent = true; - }; - }; + # Journal settings for retention. + services.journald.extraConfig = '' + MaxRetentionSec="3 month" + ''; }) ]); }