mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 07:23:20 +00:00
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.
This commit is contained in:
parent
df4f0296d7
commit
0597d1d179
@ -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 != "") ''
|
||||
|
Loading…
Reference in New Issue
Block a user