summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-09-13 09:38:45 -0700
committerFuwn <[email protected]>2024-09-13 09:38:45 -0700
commiteeb6c4c05429b80250de9a2286effa5efeb3ec27 (patch)
tree674b7d9994179c3be39d7a944f2e1f0a85b816cb
parentmodules: gpm service (diff)
downloadnixos-config-eeb6c4c05429b80250de9a2286effa5efeb3ec27.tar.xz
nixos-config-eeb6c4c05429b80250de9a2286effa5efeb3ec27.zip
modules: logrotate
-rw-r--r--modules/software/services/default.nix1
-rw-r--r--modules/software/services/logrotate.nix24
2 files changed, 25 insertions, 0 deletions
diff --git a/modules/software/services/default.nix b/modules/software/services/default.nix
index aee381c..4b9ccf6 100644
--- a/modules/software/services/default.nix
+++ b/modules/software/services/default.nix
@@ -5,6 +5,7 @@
./ananicy.nix
./dbus.nix
./libinput.nix
+ ./logrotate.nix
./ollama.nix
# ./printing.nix
./xserver.nix
diff --git a/modules/software/services/logrotate.nix b/modules/software/services/logrotate.nix
new file mode 100644
index 0000000..2dedf2e
--- /dev/null
+++ b/modules/software/services/logrotate.nix
@@ -0,0 +1,24 @@
+{ pkgs, lib, ... }:
+{
+ services.logrotate.settings = {
+ "/var/log/audit/audit.log" = { };
+
+ header = {
+ global = true;
+ dateext = true;
+ dateformat = "-%Y-%m-%d";
+ nomail = true;
+ missingok = true;
+ copytruncate = true;
+ priority = 1;
+ frequency = "daily";
+ rotate = 7;
+ minage = 1;
+ compress = true;
+ compresscmd = "${lib.getExe' pkgs.zstd "zstd"}";
+ compressoptions = " -Xcompression-level 10";
+ compressext = "zst";
+ uncompresscmd = "${lib.getExe' pkgs.zstd "unzstd"}";
+ };
+ };
+}