diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2021-09-06 11:55:48 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2021-09-06 11:55:48 +0200 |
commit | e2ea5476d7c06a7afd552618c1cdd02e2db96ee1 (patch) | |
tree | 4fceae5d5dfa2414bd2992a9f9034f1df5159a48 /user-profiles/feeds | |
parent | bde8d615a722b4b8b3b19367e83953c9f9928588 (diff) | |
download | nixos-e2ea5476d7c06a7afd552618c1cdd02e2db96ee1.tar nixos-e2ea5476d7c06a7afd552618c1cdd02e2db96ee1.tar.gz nixos-e2ea5476d7c06a7afd552618c1cdd02e2db96ee1.tar.bz2 nixos-e2ea5476d7c06a7afd552618c1cdd02e2db96ee1.tar.xz nixos-e2ea5476d7c06a7afd552618c1cdd02e2db96ee1.zip |
feeds: rotate logs
Diffstat (limited to 'user-profiles/feeds')
-rw-r--r-- | user-profiles/feeds/module.nix | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/user-profiles/feeds/module.nix b/user-profiles/feeds/module.nix index 1face90e..ffde87b8 100644 --- a/user-profiles/feeds/module.nix +++ b/user-profiles/feeds/module.nix | |||
@@ -156,5 +156,31 @@ in { | |||
156 | NOTMUCH_CONFIG=${configPath} $DRY_RUN_CMD ${pkgs.notmuch}/bin/notmuch new $NOTMUCH_VERBOSE_ARG | 156 | NOTMUCH_CONFIG=${configPath} $DRY_RUN_CMD ${pkgs.notmuch}/bin/notmuch new $NOTMUCH_VERBOSE_ARG |
157 | fi | 157 | fi |
158 | ''; | 158 | ''; |
159 | |||
160 | systemd.user.services."logrotate-imm" = { | ||
161 | Unit = { | ||
162 | Description = "Rotate imm logfile"; | ||
163 | }; | ||
164 | Service = { | ||
165 | Type = "oneshot"; | ||
166 | ExecStart = '' | ||
167 | ${pkgs.logrotate}/bin/logrotate --state ${config.xdg.configHome}/imm/imm.logrotate ${pkgs.writeText "logrotate.conf" '' | ||
168 | ${config.xdg.configHome}/imm/imm.log { | ||
169 | rotate 5 | ||
170 | size 1m | ||
171 | } | ||
172 | ''} | ||
173 | ''; | ||
174 | }; | ||
175 | }; | ||
176 | systemd.user.timers."logrotate-imm" = { | ||
177 | Timer = { | ||
178 | OnActiveSec = "6h"; | ||
179 | OnUnitActiveSec = "6h"; | ||
180 | }; | ||
181 | Install = { | ||
182 | WantedBy = ["default.target"]; | ||
183 | }; | ||
184 | }; | ||
159 | }; | 185 | }; |
160 | } | 186 | } |