totoro: install grafana

This commit is contained in:
Luke Granger-Brown 2020-12-29 20:08:55 +00:00
parent 11c4b77eab
commit 4e20db9fcc

View file

@ -205,6 +205,27 @@ in {
};
};
};
services.grafana = {
enable = true;
addr = "0.0.0.0";
domain = "grafana.int.lukegb.com";
rootUrl = "https://grafana.int.lukegb.com/";
extraOptions = let
convertName = name: lib.toUpper (builtins.replaceStrings ["." "-"] ["_" "_"] name);
convertOptionSection = sectionName: lib.mapAttrsToList (name: value: { name = "GF_${convertName sectionName}_${convertName name}"; inherit value; });
convertOptions = opts: builtins.listToAttrs (builtins.concatLists (lib.mapAttrsToList convertOptionSection opts));
in convertOptions {
"auth.proxy" = {
enabled = "true";
header_name = "X-Pomerium-Claim-Email";
header_property = "email";
headers = "username:X-Pomerium-Claim-User";
auto_sign_up = "true";
};
security.cookie_secure = "true";
};
};
system.stateVersion = "20.03";
}