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
1 changed files with 10 additions and 1 deletions
|
@ -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 a new issue