Commit 0597d1d1 authored by Maximilian Bosch's avatar Maximilian Bosch Committed by Bjørn Forsman
Browse files

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.
parent df4f0296
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -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 != "") ''