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.

authored by

Maximilian Bosch and committed by
Bjørn Forsman
0597d1d1 df4f0296

+10 -1
+10 -1
nixos/modules/system/boot/systemd/journald.nix
··· 28 28 ''; 29 29 }; 30 30 31 + services.journald.storage = mkOption { 32 + default = "persistent"; 33 + type = types.enum [ "persistent" "volatile" "auto" "none" ]; 34 + description = mdDoc '' 35 + Controls where to store journal data. See 36 + {manpage}`journald.conf(5)` for further information. 37 + ''; 38 + }; 39 + 31 40 services.journald.rateLimitBurst = mkOption { 32 41 default = 10000; 33 42 type = types.int; ··· 100 109 environment.etc = { 101 110 "systemd/journald.conf".text = '' 102 111 [Journal] 103 - Storage=persistent 112 + Storage=${cfg.storage} 104 113 RateLimitInterval=${cfg.rateLimitInterval} 105 114 RateLimitBurst=${toString cfg.rateLimitBurst} 106 115 ${optionalString (cfg.console != "") ''