Skip to content

Grafana

services.grafana.dataDir

Data directory. Type: path

Default

"/var/lib/grafana"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.declarativePlugins

If non-null, then a list of packages containing Grafana plugins to install. If set, plugins cannot be manually installed. Type: null or (list of path)

Default

null

Example

with pkgs.grafanaPlugins; [ grafana-piechart-panel ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.enable

Whether to enable grafana. Type: boolean

Default

false

Example

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.package

The grafana package to use. Type: package

Default

pkgs.grafana

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.contactPoints.path

Path to YAML contact points configuration. Can't be used with simultaneously. Can be either a directory or a single YAML file. Will end up in the store.

Type: null or path

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.contactPoints.settings

Grafana contact points configuration in Nix. Can't be used with simultaneously. See https://grafana.com/docs/grafana/latest/administration/provisioning/#contact-points for supported options.

Type: null or (submodule)

Default

null

Example

`#!nix { apiVersion = 1;

contactPoints = [{ orgId = 1; name = "cp_1"; receivers = [{ uid = "first_uid"; type = "prometheus-alertmanager"; settings.url = "http://test:9000"; }]; }];

deleteContactPoints = [{ orgId = 1; uid = "first_uid"; }]; } `

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.contactPoints.settings.apiVersion

Config file version. Type: signed integer

Default

1

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.contactPoints.settings.contactPoints

List of contact points to import or update. Type: list of (YAML value)

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.contactPoints.settings.contactPoints.*.name

Name of the contact point. Required. Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.contactPoints.settings.deleteContactPoints

List of receivers that should be deleted. Type: list of (submodule)

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.contactPoints.settings.deleteContactPoints.*.orgId

Organization ID, default = 1. Type: signed integer

Default

1

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.contactPoints.settings.deleteContactPoints.*.uid

Unique identifier for the receiver. Required. Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.muteTimings.path

Path to YAML mute timings configuration. Can't be used with simultaneously. Can be either a directory or a single YAML file. Will end up in the store.

Type: null or path

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.muteTimings.settings

Grafana mute timings configuration in Nix. Can't be used with simultaneously. See https://grafana.com/docs/grafana/latest/administration/provisioning/#mute-timings for supported options.

Type: null or (submodule)

Default

null

Example

`#!nix { apiVersion = 1;

muteTimes = [{ orgId = 1; name = "mti_1"; time_intervals = [{ times = [{ start_time = "06:00"; end_time = "23:59"; }]; weekdays = [ "monday:wednesday" "saturday" "sunday" ]; months = [ "1:3" "may:august" "december" ]; years = [ "2020:2022" "2030" ]; days_of_month = [ "1:5" "-3:-1" ]; }]; }];

deleteMuteTimes = [{ orgId = 1; name = "mti_1"; }]; } `

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.muteTimings.settings.apiVersion

Config file version. Type: signed integer

Default

1

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.muteTimings.settings.deleteMuteTimes

List of mute time intervals that should be deleted. Type: list of (submodule)

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.muteTimings.settings.deleteMuteTimes.*.name

Name of the mute time interval, must be unique. Required. Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.muteTimings.settings.deleteMuteTimes.*.orgId

Organization ID, default = 1. Type: signed integer

Default

1

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.muteTimings.settings.muteTimes

List of mute time intervals to import or update. Type: list of (YAML value)

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.muteTimings.settings.muteTimes.*.name

Name of the mute time interval, must be unique. Required. Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.policies.path

Path to YAML notification policies configuration. Can't be used with simultaneously. Can be either a directory or a single YAML file. Will end up in the store.

Type: null or path

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.policies.settings

Grafana notification policies configuration in Nix. Can't be used with simultaneously. See https://grafana.com/docs/grafana/latest/administration/provisioning/#notification-policies for supported options.

Type: null or (submodule)

Default

null

Example

`#!nix { apiVersion = 1;

policies = [{ orgId = 1; receiver = "grafana-default-email"; group_by = [ "..." ]; matchers = [ "alertname = Watchdog" "severity =~ \"warning|critical\"" ]; mute_time_intervals = [ "abc" ]; group_wait = "30s"; group_interval = "5m"; repeat_interval = "4h"; }];

resetPolicies = [ 1 ]; } `

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.policies.settings.apiVersion

Config file version. Type: signed integer

Default

1

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.policies.settings.policies

List of contact points to import or update. Type: list of (YAML value)

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.policies.settings.resetPolicies

List of orgIds that should be reset to the default policy. Type: list of signed integer

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.rules.path

Path to YAML rules configuration. Can't be used with simultaneously. Can be either a directory or a single YAML file. Will end up in the store.

Type: null or path

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.rules.settings

Grafana rules configuration in Nix. Can't be used with simultaneously. See https://grafana.com/docs/grafana/latest/administration/provisioning/#rules for supported options.

Type: null or (submodule)

Default

null

Example

`#!nix { apiVersion = 1;

groups = [{ orgId = 1; name = "my_rule_group"; folder = "my_first_folder"; interval = "60s"; rules = [{ uid = "my_id_1"; title = "my_first_rule"; condition = "A"; data = [{ refId = "A"; datasourceUid = "-100"; model = { conditions = [{ evaluator = { params = [ 3 ]; type = "git"; }; operator.type = "and"; query.params = [ "A" ]; reducer.type = "last"; type = "query"; }]; datasource = { type = "expr"; uid = "-100"; }; expression = "1==0"; intervalMs = 1000; maxDataPoints = 43200; refId = "A"; type = "math"; }; }]; dashboardUid = "my_dashboard"; panelId = 123; noDataState = "Alerting"; for = "60s"; annotations.some_key = "some_value"; labels.team = "sre_team1"; }]; }];

deleteRules = [{ orgId = 1; uid = "my_id_1"; }]; } `

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.rules.settings.apiVersion

Config file version. Type: signed integer

Default

1

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.rules.settings.deleteRules

List of alert rule UIDs that should be deleted. Type: list of (submodule)

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.rules.settings.deleteRules.*.orgId

Organization ID, default = 1 Type: signed integer

Default

1

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.rules.settings.deleteRules.*.uid

Unique identifier for the rule. Required. Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.rules.settings.groups

List of rule groups to import or update. Type: list of (YAML value)

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.rules.settings.groups.*.folder

Name of the folder the rule group will be stored in. Required. Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.rules.settings.groups.*.interval

Interval that the rule group should be evaluated at. Required. Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.rules.settings.groups.*.name

Name of the rule group. Required. Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.templates.path

Path to YAML templates configuration. Can't be used with simultaneously. Can be either a directory or a single YAML file. Will end up in the store.

Type: null or path

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.templates.settings

Grafana templates configuration in Nix. Can't be used with simultaneously. See https://grafana.com/docs/grafana/latest/administration/provisioning/#templates for supported options.

Type: null or (submodule)

Default

null

Example

`#!nix { apiVersion = 1;

templates = [{ orgId = 1; name = "my_first_template"; template = "Alerting with a custom text template"; }];

deleteTemplates = [{ orgId = 1; name = "my_first_template"; }]; } `

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.templates.settings.apiVersion

Config file version. Type: signed integer

Default

1

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.templates.settings.deleteTemplates

List of alert rule UIDs that should be deleted. Type: list of (submodule)

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.templates.settings.deleteTemplates.*.name

Name of the template, must be unique. Required. Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.templates.settings.deleteTemplates.*.orgId

Organization ID, default = 1. Type: signed integer

Default

1

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.templates.settings.templates

List of templates to import or update. Type: list of (YAML value)

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.templates.settings.templates.*.name

Name of the template, must be unique. Required. Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.alerting.templates.settings.templates.*.template

Alerting with a custom text template Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.dashboards

Declaratively provision Grafana's dashboards.

Type: submodule

Default

{ }

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.dashboards.path

Path to YAML dashboard configuration. Can't be used with simultaneously. Can be either a directory or a single YAML file. Will end up in the store.

Type: null or path

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.dashboards.settings

Grafana dashboard configuration in Nix. Can't be used with simultaneously. See https://grafana.com/docs/grafana/latest/administration/provisioning/#dashboards for supported options.

Type: null or (submodule)

Default

null

Example

`#!nix { apiVersion = 1;

providers = [{ name = "default"; options.path = "/var/lib/grafana/dashboards"; }]; } `

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.dashboards.settings.apiVersion

Config file version. Type: signed integer

Default

1

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.dashboards.settings.providers

List of dashboards to insert/update. Type: list of (YAML value)

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.dashboards.settings.providers.*.name

A unique provider name. Type: string

Default

"default"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.dashboards.settings.providers.*.options.path

Path grafana will watch for dashboards. Required when using the 'file' type. Type: path

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.dashboards.settings.providers.*.type

Dashboard provider type. Type: string

Default

"file"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.datasources

Declaratively provision Grafana's datasources.

Type: submodule

Default

{ }

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.datasources.path

Path to YAML datasource configuration. Can't be used with simultaneously. Can be either a directory or a single YAML file. Will end up in the store.

Type: null or path

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.datasources.settings

Grafana datasource configuration in Nix. Can't be used with simultaneously. See https://grafana.com/docs/grafana/latest/administration/provisioning/#data-sources for supported options.

Type: null or (submodule)

Default

null

Example

`#!nix { apiVersion = 1;

datasources = [{ name = "Graphite"; type = "graphite"; }];

deleteDatasources = [{ name = "Graphite"; orgId = 1; }]; } `

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.datasources.settings.apiVersion

Config file version. Type: signed integer

Default

1

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.datasources.settings.datasources

List of datasources to insert/update. Type: list of (YAML value)

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.datasources.settings.datasources.*.access

Access mode. proxy or direct (Server or Browser in the UI). Required. Type: one of "proxy", "direct"

Default

"proxy"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.datasources.settings.datasources.*.editable

Allow users to edit datasources from the UI. Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.datasources.settings.datasources.*.jsonData

Extra data for datasource plugins. Type: null or (attribute set)

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.datasources.settings.datasources.*.name

Name of the datasource. Required. Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.datasources.settings.datasources.*.secureJsonData

Datasource specific secure configuration. Please note that the contents of this option will end up in a world-readable Nix store. Use the file provider pointing at a reasonably secured file in the local filesystem to work around that. Look at the documentation for details: https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#file-provider

Type: null or (attribute set)

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.datasources.settings.datasources.*.type

Datasource type. Required. Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.datasources.settings.datasources.*.uid

Custom UID which can be used to reference this datasource in other parts of the configuration, if not specified will be generated automatically. Type: null or string

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.datasources.settings.datasources.*.url

Url of the datasource. Type: string

Default

""

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.datasources.settings.deleteDatasources

List of datasources that should be deleted from the database. Type: list of (submodule)

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.datasources.settings.deleteDatasources.*.name

Name of the datasource to delete. Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.datasources.settings.deleteDatasources.*.orgId

Organization ID of the datasource to delete. Type: signed integer

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.provision.enable

Whether to enable provision. Type: boolean

Default

false

Example

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings

Grafana settings. See https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/ for available options. INI format is used.

Type: attribute set of section of an INI file (attrs of INI atom (null, bool, int, float or string) or a non-empty list of them)

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.analytics.check_for_plugin_updates

When set to false, disables checking for new versions of installed plugins from https://grafana.com. When enabled, the check for a new plugin runs every 10 minutes. It will notify, via the UI, when a new plugin update exists. The check itself will not prompt any auto-updates of the plugin, nor will it send any sensitive information.

Type: boolean

Default

cfg.declarativePlugins == null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.analytics.check_for_updates

When set to false, disables checking for new versions of Grafana from Grafana's GitHub repository. When enabled, the check for a new version runs every 10 minutes. It will notify, via the UI, when a new version is available. The check itself will not prompt any auto-updates of the Grafana software, nor will it send any sensitive information.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

Set to false to remove all feedback links from the UI. Type: boolean

Default

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.analytics.reporting_enabled

When enabled Grafana will send anonymous usage statistics to stats.grafana.org. No IP addresses are being tracked, only simple counters to track running instances, versions, dashboard and error counts. Counters are sent every 24 hours.

Type: boolean

Default

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.ca_cert_path

The path to the CA certificate to use. Type: null or string

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.cache_mode

For sqlite3 only. Shared cache setting used for connecting to the database.

Type: one of "private", "shared"

Default

"private"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.client_cert_path

The path to the client cert. Only if server requires client authentication. Type: null or string

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.client_key_path

The path to the client key. Only if server requires client authentication. Type: null or string

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.conn_max_lifetime

Sets the maximum amount of time a connection may be reused. The default is 14400 (which means 14400 seconds or 4 hours). For MySQL, this setting should be shorter than the wait_timeout variable.

Type: signed integer

Default

14400

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.host

Only applicable to MySQL or Postgres. Includes IP or hostname and port or in case of Unix sockets the path to it. For example, for MySQL running on the same host as Grafana: host = "127.0.0.1:3306" or with Unix sockets: host = "/var/run/mysqld/mysqld.sock"

Type: string

Default

"127.0.0.1:3306"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.isolation_level

Only the MySQL driver supports isolation levels in Grafana. In case the value is empty, the driver's default isolation level is applied.

Type: null or one of "READ-UNCOMMITTED", "READ-COMMITTED", "REPEATABLE-READ", "SERIALIZABLE"

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.locking_attempt_timeout_sec

For mysql, if the migrationLocking feature toggle is set, specify the time (in seconds) to wait before failing to lock the database for the migrations.

Type: signed integer

Default

0

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.log_queries

Set to true to log the sql calls and execution times Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.max_idle_conn

The maximum number of connections in the idle connection pool. Type: signed integer

Default

2

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.max_open_conn

The maximum number of open connections to the database. Type: signed integer

Default

0

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.name

The name of the Grafana database. Type: string

Default

"grafana"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.password

The database user's password (not applicable for sqlite3).

Please note that the contents of this option will end up in a world-readable Nix store. Use the file provider pointing at a reasonably secured file in the local filesystem to work around that. Look at the documentation for details: https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#file-provider

Type: string

Default

""

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.path

Only applicable to sqlite3 database. The file path where the database will be stored. Type: path

Default

"${config.services.grafana.dataDir}/data/grafana.db"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.query_retries

This setting applies to sqlite3 only and controls the number of times the system retries a query when the database is locked.

Type: signed integer

Default

0

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.server_cert_name

The common name field of the certificate used by the mysql or postgres server. Not necessary if ssl_mode is set to skip-verify.

Type: null or string

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.ssl_mode

For Postgres, use either disable, require or verify-full. For MySQL, use either true, false, or skip-verify.

Type: one of "disable", "require", "verify-full", "true", "false", "skip-verify"

Default

"disable"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.transaction_retries

This setting applies to sqlite3 only and controls the number of times the system retries a transaction when the database is locked.

Type: signed integer

Default

5

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.type

Database type. Type: one of "mysql", "sqlite3", "postgres"

Default

"sqlite3"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.user

The database user (not applicable for sqlite3). Type: string

Default

"root"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.database.wal

For sqlite3 only. Setting to enable/disable Write-Ahead Logging.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.paths.plugins

Directory where grafana will automatically scan and look for plugins Type: path

Default

if (cfg.declarativePlugins == null) then "${cfg.dataDir}/plugins" else declarativePlugins

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.paths.provisioning

Folder that contains provisioning config files that grafana will apply on startup and while running. Don't change the value of this option if you are planning to use services.grafana.provision options.

Type: path

Default

"directory with links to files generated from services.grafana.provision"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.admin_email

The email of the default Grafana Admin, created on startup. Type: string

Default

"admin@localhost"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.admin_password

Default admin password. Please note that the contents of this option will end up in a world-readable Nix store. Use the file provider pointing at a reasonably secured file in the local filesystem to work around that. Look at the documentation for details: https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#file-provider

Type: string

Default

"admin"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.admin_user

Default admin username. Type: string

Default

"admin"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.allow_embedding

When false, the HTTP header X-Frame-Options: deny will be set in Grafana HTTP responses which will instruct browsers to not allow rendering Grafana in a <frame>, <iframe>, <embed> or <object>. The main goal is to mitigate the risk of Clickjacking.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.content_security_policy

Set to true to add the Content-Security-Policy header to your requests. CSP allows to control resources that the user agent can load and helps prevent XSS attacks.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.content_security_policy_report_only

Set to true to add the Content-Security-Policy-Report-Only header to your requests. CSP in Report Only mode enables you to experiment with policies by monitoring their effects without enforcing them. You can enable both policies simultaneously.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.cookie_samesite

Sets the SameSite cookie attribute and prevents the browser from sending this cookie along with cross-site requests. The main goal is to mitigate the risk of cross-origin information leakage. This setting also provides some protection against cross-site request forgery attacks (CSRF), read more about SameSite here. Using value disabled does not add any SameSite attribute to cookies.

Type: one of "lax", "strict", "none", "disabled"

Default

"lax"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.cookie_secure

Set to true if you host Grafana behind HTTPS. Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.csrf_additional_headers

List of allowed headers to be set by the user. Suggested to use for if authentication lives behind reverse proxies.

Type: string or list of string

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.csrf_trusted_origins

List of additional allowed URLs to pass by the CSRF check. Suggested when authentication comes from an IdP.

Type: string or list of string

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.data_source_proxy_whitelist

Define a whitelist of allowed IP addresses or domains, with ports, to be used in data source URLs with the Grafana data source proxy. Format: ip_or_domain:port separated by spaces. PostgreSQL, MySQL, and MSSQL data sources do not use the proxy and are therefore unaffected by this setting.

Type: string or list of string

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.disable_brute_force_login_protection

Set to true to disable brute force login protection. Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.disable_gravatar

Set to true to disable the use of Gravatar for user profile images. Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.disable_initial_admin_creation

Disable creation of admin user on first start of Grafana. Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.secret_key

Secret key used for signing. Please note that the contents of this option will end up in a world-readable Nix store. Use the file provider pointing at a reasonably secured file in the local filesystem to work around that. Look at the documentation for details: https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#file-provider

Type: string

Default

"SW2YcwTIb9zpOOhoPsMm"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.strict_transport_security

Set to true if you want to enable HTTP Strict-Transport-Security (HSTS) response header. Only use this when HTTPS is enabled in your configuration, or when there is another upstream system that ensures your application does HTTPS (like a frontend load balancer). HSTS tells browsers that the site should only be accessed using HTTPS.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.strict_transport_security_max_age_seconds

Sets how long a browser should cache HSTS in seconds. Only applied if strict_transport_security is enabled.

Type: signed integer

Default

86400

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.strict_transport_security_preload

Set to true to enable HSTS preloading option. Only applied if strict_transport_security is enabled.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.strict_transport_security_subdomains

Set to true to enable HSTS includeSubDomains option. Only applied if strict_transport_security is enabled.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.x_content_type_options

Set to false to disable the X-Content-Type-Options response header. The X-Content-Type-Options response HTTP header is a marker used by the server to indicate that the MIME types advertised in the Content-Type headers should not be changed and be followed.

Type: boolean

Default

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.security.x_xss_protection

Set to false to disable the X-XSS-Protection header, which tells browsers to stop pages from loading when they detect reflected cross-site scripting (XSS) attacks.

Type: boolean

Default

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.server.cdn_url

Specify a full HTTP URL address to the root of your Grafana CDN assets. Grafana will add edition and version paths.

For example, given a cdn url like https://cdn.myserver.com grafana will try to load a javascript file from http://cdn.myserver.com/grafana-oss/7.4.0/public/build/app.<hash>.js.

Type: null or string

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.server.cert_file

Path to the certificate file (if protocol is set to https or h2).

Type: null or string

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.server.cert_key

Path to the certificate key file (if protocol is set to https or h2).

Type: null or string

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.server.domain

The public facing domain name used to access grafana from a browser.

This setting is only used in the default value of the root_url setting. If you set the latter manually, this option does not have to be specified.

Type: string

Default

"localhost"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.server.enable_gzip

Set this option to true to enable HTTP compression, this can improve transfer speed and bandwidth utilization. It is recommended that most users set it to true. By default it is set to false for compatibility reasons.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.server.enforce_domain

Redirect to correct domain if the host header does not match the domain. Prevents DNS rebinding attacks.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.server.http_addr

Listening address.

::: {.note} This setting intentionally varies from upstream's default to be a bit more secure by default. :::

Type: string

Default

"127.0.0.1"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.server.http_port

Listening port. Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)

Default

3000

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.server.protocol

Which protocol to listen. Type: one of "http", "https", "h2", "socket"

Default

"http"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.server.read_timeout

Sets the maximum time using a duration format (5s/5m/5ms) before timing out read of an incoming request and closing idle connections. 0 means there is no timeout for reading the request.

Type: string

Default

"0"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.server.root_url

This is the full URL used to access Grafana from a web browser. This is important if you use Google or GitHub OAuth authentication (for the callback URL to be correct).

This setting is also important if you have a reverse proxy in front of Grafana that exposes it through a subpath. In that case add the subpath to the end of this URL setting.

Type: string

Default

"%(protocol)s://%(domain)s:%(http_port)s/"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.server.router_logging

Set to true for Grafana to log all HTTP requests (not just errors). These are logged as Info level events to the Grafana log.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.server.serve_from_sub_path

Serve Grafana from subpath specified in the root_url setting. By default it is set to false for compatibility reasons.

By enabling this setting and using a subpath in root_url above, e.g. root_url = "http://localhost:3000/grafana", Grafana is accessible on http://localhost:3000/grafana. If accessed without subpath, Grafana will redirect to an URL with the subpath.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.server.socket

Path where the socket should be created when protocol=socket. Make sure that Grafana has appropriate permissions before you change this setting.

Type: string

Default

"/run/grafana/grafana.sock"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.server.socket_gid

GID where the socket should be set when protocol=socket. Make sure that the target group is in the group of Grafana process and that Grafana process is the file owner before you change this setting. It is recommended to set the gid as http server user gid. Not set when the value is -1.

Type: signed integer

Default

-1

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.server.socket_mode

Mode where the socket should be set when protocol=socket. Make sure that Grafana process is the file owner before you change this setting.

Type: string

Default

"0660"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.server.static_root_path

Root path for static assets. Type: string

Default

"${package}/share/grafana/public"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.smtp.cert_file

File path to a cert file. Type: null or string

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.smtp.ehlo_identity

Name to be used as client identity for EHLO in SMTP dialog. Type: null or string

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.smtp.enabled

Whether to enable SMTP. Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.smtp.from_address

Address used when sending out emails. Type: string

Default

"admin@grafana.localhost"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.smtp.from_name

Name to be used as client identity for EHLO in SMTP dialog. Type: string

Default

"Grafana"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.smtp.host

Host to connect to. Type: string

Default

"localhost:25"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.smtp.key_file

File path to a key file. Type: null or string

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.smtp.password

Password used for authentication. Please note that the contents of this option will end up in a world-readable Nix store. Use the file provider pointing at a reasonably secured file in the local filesystem to work around that. Look at the documentation for details: https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#file-provider

Type: string

Default

""

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.smtp.skip_verify

Verify SSL for SMTP server. Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.smtp.startTLS_policy

StartTLS policy when connecting to server. Type: null or one of "OpportunisticStartTLS", "MandatoryStartTLS", "NoStartTLS"

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.smtp.user

User used for authentication. Type: null or string

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.users.allow_org_create

Set to false to prohibit users from creating new organizations. Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.users.allow_sign_up

Set to false to prohibit users from being able to sign up / create user accounts. The admin user can still create users.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.users.auto_assign_org

Set to true to automatically add new users to the main organization (id 1). When set to false, new users automatically cause a new organization to be created for that new user. The organization will be created even if the allow_org_create setting is set to false.

Type: boolean

Default

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.users.auto_assign_org_id

Set this value to automatically add new users to the provided org. This requires auto_assign_org to be set to true. Please make sure that this organization already exists.

Type: signed integer

Default

1

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.users.auto_assign_org_role

The role new users will be assigned for the main organization (if the auto_assign_org setting is set to true).

Type: one of "Viewer", "Editor", "Admin"

Default

"Viewer"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.users.default_language

This setting configures the default UI language, which must be a supported IETF language tag, such as en-US. Type: string

Default

"en-US"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.users.default_theme

Sets the default UI theme. system matches the user's system theme. Type: one of "dark", "light", "system"

Default

"dark"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.users.editors_can_admin

Editors can administrate dashboards, folders and teams they create. Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.users.hidden_users

This is a comma-separated list of usernames. Users specified here are hidden in the Grafana UI. They are still visible to Grafana administrators and to themselves.

Type: string

Default

""

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.users.home_page

Path to a custom home page. Users are only redirected to this if the default home dashboard is used. It should match a frontend route and contain a leading slash.

Type: string

Default

""

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.users.login_hint

Text used as placeholder text on login page for login/username input. Type: string

Default

"email or username"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.users.password_hint

Text used as placeholder text on login page for password input. Type: string

Default

"password"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.users.user_invite_max_lifetime_duration

The duration in time a user invitation remains valid before expiring. This setting should be expressed as a duration. Examples: 6h (hours), 2d (days), 1w (week). The minimum supported duration is 15m (15 minutes).

Type: string

Default

"24h"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.users.verify_email_enabled

Require email validation before sign up completes. Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix

services.grafana.settings.users.viewers_can_edit

Viewers can access and use Explore and perform temporary edits on panels in dashboards they have access to. They cannot save their changes.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/monitoring/grafana.nix