22
0
mirror of https://github.com/SuperSandro2000/nixos-modules.git synced 2024-06-15 04:16:55 +02:00

Add grafana

This commit is contained in:
Sandro - 2022-12-23 05:53:53 +01:00
parent fe7db01b4b
commit 32d041f323
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5

30
modules/grafana.nix Normal file
View File

@ -0,0 +1,30 @@
{ config, lib, ...}:
let
cfg = config.services.grafana;
in
{
options.services.grafana.opinionatedDefaults = lib.mkOption {
type = lib.types.bool;
default = config.opinionatedDefaults;
description = lib.mdDoc "Wether to enable set opinionated default settings.";
};
config = lib.mkIf cfg.enable {
services.grafana.settings = lib.mkIf cfg.opinionatedDefaults (lib.mapAttrsRecursive (path: value: lib.mkDefault value) {
analytics = {
check_for_updates = false;
reporting_enabled = false;
};
security = {
cookie_secure = true;
content_security_policy = true;
};
server = {
enable_gzip = true;
http_addr = "127.0.0.1";
root_url = "https://${cfg.settings.server.domain}";
};
});
};
}