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:
parent
fe7db01b4b
commit
32d041f323
30
modules/grafana.nix
Normal file
30
modules/grafana.nix
Normal 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}";
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user