Revert to loki v2 (#230)
This is needed because v3 requires manual intervention to upgrade otherwise Loki refuses to start. So until there's a fix, reverting is the easiest fix.
This commit is contained in:
parent
425e511792
commit
222dfa755c
2 changed files with 41 additions and 0 deletions
9
CHANGELOG.md
Normal file
9
CHANGELOG.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
# Upcoming
|
||||
|
||||
- Revert Loki to major version 2 because upgrading to version 3 required manual intervention as Loki
|
||||
refuses to start. So until this issue is tackled, reverting is the best immediate fix.
|
||||
See https://github.com/NixOS/nixpkgs/commit/8f95320f39d7e4e4a29ee70b8718974295a619f4
|
||||
|
||||
# 0.1.0
|
||||
|
||||
Creation of CHANGELOG.md
|
|
@ -47,6 +47,16 @@ in
|
|||
default = 3002;
|
||||
};
|
||||
|
||||
lokiMajorVersion = lib.mkOption {
|
||||
type = lib.types.enum [ 2 3 ];
|
||||
description = ''
|
||||
Switching from version 2 to 3 requires manual intervention
|
||||
https://grafana.com/docs/loki/latest/setup/upgrade/#main--unreleased. So this let's the user
|
||||
upgrade at their own pace.
|
||||
'';
|
||||
default = 2;
|
||||
};
|
||||
|
||||
debugLog = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "Set to true to enable debug logging of the infrastructure serving Grafana.";
|
||||
|
@ -266,6 +276,28 @@ in
|
|||
services.loki = {
|
||||
enable = true;
|
||||
dataDir = "/var/lib/loki";
|
||||
package = if cfg.lokiMajorVersion == 3 then pkgs.grafana-loki else
|
||||
# Comes from https://github.com/NixOS/nixpkgs/commit/8f95320f39d7e4e4a29ee70b8718974295a619f4
|
||||
(pkgs.grafana-loki.overrideAttrs (finalAttrs: previousAttrs: rec {
|
||||
version = "2.9.6";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "grafana";
|
||||
repo = "loki";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-79hK7axHf6soku5DvdXkE/0K4WKc4pnS9VMbVc1FS2I=";
|
||||
};
|
||||
|
||||
ldflags = let t = "github.com/grafana/loki/pkg/util/build"; in [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X ${t}.Version=${version}"
|
||||
"-X ${t}.BuildUser=nix@nixpkgs"
|
||||
"-X ${t}.BuildDate=unknown"
|
||||
"-X ${t}.Branch=unknown"
|
||||
"-X ${t}.Revision=unknown"
|
||||
];
|
||||
}));
|
||||
configuration = {
|
||||
auth_enabled = false;
|
||||
|
||||
|
|
Loading…
Reference in a new issue