diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2023-11-03 18:21:50 +0100 |
---|---|---|
committer | Bjørn Forsman <bjorn.forsman@gmail.com> | 2023-11-07 14:06:27 +0100 |
commit | 0597d1d1796332af7ef24ad7d685badf9bcf0e63 (patch) | |
tree | 3f7b7b15b93b1c83d051af194395f4878ae1ce6f /nixos/modules/system | |
parent | df4f0296d7947ee9a228d99c21cd8875c64148b8 (diff) |
nixos/journald: add `storage` option
While this can be added via `services.journald.extraConfig`, this option provides proper type-checking and other modules can determine where journal data is stored. This is relevant when using e.g. promtail to send logs to Loki and it should read from `/run/log/journal` if volatile storage is used.
Diffstat (limited to 'nixos/modules/system')
-rw-r--r-- | nixos/modules/system/boot/systemd/journald.nix | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/nixos/modules/system/boot/systemd/journald.nix b/nixos/modules/system/boot/systemd/journald.nix index 773163bbcb811..7e62a4c9bfedf 100644 --- a/nixos/modules/system/boot/systemd/journald.nix +++ b/nixos/modules/system/boot/systemd/journald.nix @@ -28,6 +28,15 @@ in { ''; }; + services.journald.storage = mkOption { + default = "persistent"; + type = types.enum [ "persistent" "volatile" "auto" "none" ]; + description = mdDoc '' + Controls where to store journal data. See + {manpage}`journald.conf(5)` for further information. + ''; + }; + services.journald.rateLimitBurst = mkOption { default = 10000; type = types.int; @@ -100,7 +109,7 @@ in { environment.etc = { "systemd/journald.conf".text = '' [Journal] - Storage=persistent + Storage=${cfg.storage} RateLimitInterval=${cfg.rateLimitInterval} RateLimitBurst=${toString cfg.rateLimitBurst} ${optionalString (cfg.console != "") '' |