diff options
author | Alyssa Ross <hi@alyssa.is> | 2024-05-03 15:14:25 +0200 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2024-05-07 11:19:19 +0200 |
commit | d92b2b6a1bbd322dd65a8b6f51019610d350046e (patch) | |
tree | 7f7c21927b9cc05676501f297c51eb76b49e326c /nixpkgs/nixos/modules/services/monitoring | |
parent | 93c9e56b40530cc627d921cfc255c05b495d4017 (diff) | |
parent | 49050352f602fe87d16ff7b2b6a05b79eb20dc6f (diff) | |
download | nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.gz nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.bz2 nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.lz nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.xz nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.zst nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.zip |
Merge remote-tracking branch 'nixpkgs/nixos-unstable-small'
Conflicts: nixpkgs/nixos/modules/services/mail/mailman.nix nixpkgs/nixos/modules/services/mail/public-inbox.nix nixpkgs/pkgs/build-support/go/module.nix
Diffstat (limited to 'nixpkgs/nixos/modules/services/monitoring')
143 files changed, 1662 insertions, 1247 deletions
diff --git a/nixpkgs/nixos/modules/services/monitoring/alerta.nix b/nixpkgs/nixos/modules/services/monitoring/alerta.nix index 0b0ab177e5e1..32c71e730102 100644 --- a/nixpkgs/nixos/modules/services/monitoring/alerta.nix +++ b/nixpkgs/nixos/modules/services/monitoring/alerta.nix @@ -21,58 +21,58 @@ let in { options.services.alerta = { - enable = mkEnableOption (lib.mdDoc "alerta"); + enable = mkEnableOption "alerta"; port = mkOption { type = types.port; default = 5000; - description = lib.mdDoc "Port of Alerta"; + description = "Port of Alerta"; }; bind = mkOption { type = types.str; default = "0.0.0.0"; - description = lib.mdDoc "Address to bind to. The default is to bind to all addresses"; + description = "Address to bind to. The default is to bind to all addresses"; }; logDir = mkOption { type = types.path; - description = lib.mdDoc "Location where the logfiles are stored"; + description = "Location where the logfiles are stored"; default = "/var/log/alerta"; }; databaseUrl = mkOption { type = types.str; - description = lib.mdDoc "URL of the MongoDB or PostgreSQL database to connect to"; + description = "URL of the MongoDB or PostgreSQL database to connect to"; default = "mongodb://localhost"; }; databaseName = mkOption { type = types.str; - description = lib.mdDoc "Name of the database instance to connect to"; + description = "Name of the database instance to connect to"; default = "monitoring"; }; corsOrigins = mkOption { type = types.listOf types.str; - description = lib.mdDoc "List of URLs that can access the API for Cross-Origin Resource Sharing (CORS)"; + description = "List of URLs that can access the API for Cross-Origin Resource Sharing (CORS)"; default = [ "http://localhost" "http://localhost:5000" ]; }; authenticationRequired = mkOption { type = types.bool; - description = lib.mdDoc "Whether users must authenticate when using the web UI or command-line tool"; + description = "Whether users must authenticate when using the web UI or command-line tool"; default = false; }; signupEnabled = mkOption { type = types.bool; - description = lib.mdDoc "Whether to prevent sign-up of new users via the web UI"; + description = "Whether to prevent sign-up of new users via the web UI"; default = true; }; extraConfig = mkOption { - description = lib.mdDoc "These lines go into alertad.conf verbatim."; + description = "These lines go into alertad.conf verbatim."; default = ""; type = types.lines; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/apcupsd.nix b/nixpkgs/nixos/modules/services/monitoring/apcupsd.nix index 666479c78a84..09cf593f5d5e 100644 --- a/nixpkgs/nixos/modules/services/monitoring/apcupsd.nix +++ b/nixpkgs/nixos/modules/services/monitoring/apcupsd.nix @@ -90,7 +90,7 @@ in enable = mkOption { default = false; type = types.bool; - description = lib.mdDoc '' + description = '' Whether to enable the APC UPS daemon. apcupsd monitors your UPS and permits orderly shutdown of your computer in the event of a power failure. User manual: http://www.apcupsd.com/manual/manual.html. @@ -107,7 +107,7 @@ in MINUTES 5 ''; type = types.lines; - description = lib.mdDoc '' + description = '' Contents of the runtime configuration file, apcupsd.conf. The default settings makes apcupsd autodetect USB UPSes, limit network access to localhost and shutdown the system when the battery level is below 50 @@ -122,7 +122,7 @@ in doshutdown = "# shell commands to notify that the computer is shutting down"; }; type = types.attrsOf types.lines; - description = lib.mdDoc '' + description = '' Each attribute in this option names an apcupsd event and the string value it contains will be executed in a shell, in response to that event (prior to the default action). See "man apccontrol" for the diff --git a/nixpkgs/nixos/modules/services/monitoring/arbtt.nix b/nixpkgs/nixos/modules/services/monitoring/arbtt.nix index a1a228d6e420..6dad6bdec328 100644 --- a/nixpkgs/nixos/modules/services/monitoring/arbtt.nix +++ b/nixpkgs/nixos/modules/services/monitoring/arbtt.nix @@ -7,7 +7,7 @@ let in { options = { services.arbtt = { - enable = mkEnableOption (lib.mdDoc "Arbtt statistics capture service"); + enable = mkEnableOption "Arbtt statistics capture service"; package = mkPackageOption pkgs [ "haskellPackages" "arbtt" ] { }; @@ -15,7 +15,7 @@ in { type = types.str; default = "%h/.arbtt/capture.log"; example = "/home/username/.arbtt-capture.log"; - description = lib.mdDoc '' + description = '' The log file for captured samples. ''; }; @@ -24,7 +24,7 @@ in { type = types.int; default = 60; example = 120; - description = lib.mdDoc '' + description = '' The sampling interval in seconds. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/below.nix b/nixpkgs/nixos/modules/services/monitoring/below.nix index 4a7135162ac4..729734828142 100644 --- a/nixpkgs/nixos/modules/services/monitoring/below.nix +++ b/nixpkgs/nixos/modules/services/monitoring/below.nix @@ -13,10 +13,10 @@ let mkDisableOption = n: mkOption { type = types.bool; default = true; - description = mdDoc "Whether to enable ${n}."; + description = "Whether to enable ${n}."; }; optionalType = ty: x: mkOption (x // { - description = mdDoc x.description; + description = x.description; type = (types.nullOr ty); default = null; }); @@ -26,7 +26,7 @@ let in { options = { services.below = { - enable = mkEnableOption (mdDoc "'below' resource monitor"); + enable = mkEnableOption "'below' resource monitor"; cgroupFilterOut = optionalStr { description = "A regexp matching the full paths of cgroups whose data shouldn't be collected"; @@ -34,10 +34,10 @@ in { }; collect = { diskStats = mkDisableOption "dist_stat collection"; - ioStats = mkEnableOption (mdDoc "io.stat collection for cgroups"); + ioStats = mkEnableOption "io.stat collection for cgroups"; exitStats = mkDisableOption "eBPF-based exitstats"; }; - compression.enable = mkEnableOption (mdDoc "data compression"); + compression.enable = mkEnableOption "data compression"; retention = { size = optionalInt { description = '' diff --git a/nixpkgs/nixos/modules/services/monitoring/bosun.nix b/nixpkgs/nixos/modules/services/monitoring/bosun.nix index fb412d43ec27..4b855b96e949 100644 --- a/nixpkgs/nixos/modules/services/monitoring/bosun.nix +++ b/nixpkgs/nixos/modules/services/monitoring/bosun.nix @@ -22,14 +22,14 @@ in { services.bosun = { - enable = mkEnableOption (lib.mdDoc "bosun"); + enable = mkEnableOption "bosun"; package = mkPackageOption pkgs "bosun" { }; user = mkOption { type = types.str; default = "bosun"; - description = lib.mdDoc '' + description = '' User account under which bosun runs. ''; }; @@ -37,7 +37,7 @@ in { group = mkOption { type = types.str; default = "bosun"; - description = lib.mdDoc '' + description = '' Group account under which bosun runs. ''; }; @@ -45,7 +45,7 @@ in { opentsdbHost = mkOption { type = types.nullOr types.str; default = "localhost:4242"; - description = lib.mdDoc '' + description = '' Host and port of the OpenTSDB database that stores bosun data. To disable opentsdb you can pass null as parameter. ''; @@ -55,7 +55,7 @@ in { type = types.nullOr types.str; default = null; example = "localhost:8086"; - description = lib.mdDoc '' + description = '' Host and port of the influxdb database. ''; }; @@ -63,7 +63,7 @@ in { listenAddress = mkOption { type = types.str; default = ":8070"; - description = lib.mdDoc '' + description = '' The host address and port that bosun's web interface will listen on. ''; }; @@ -71,7 +71,7 @@ in { stateFile = mkOption { type = types.path; default = "/var/lib/bosun/bosun.state"; - description = lib.mdDoc '' + description = '' Path to bosun's state file. ''; }; @@ -79,7 +79,7 @@ in { ledisDir = mkOption { type = types.path; default = "/var/lib/bosun/ledis_data"; - description = lib.mdDoc '' + description = '' Path to bosun's ledis data dir ''; }; @@ -87,7 +87,7 @@ in { checkFrequency = mkOption { type = types.str; default = "5m"; - description = lib.mdDoc '' + description = '' Bosun's check frequency ''; }; @@ -95,7 +95,7 @@ in { extraConfig = mkOption { type = types.lines; default = ""; - description = lib.mdDoc '' + description = '' Extra configuration options for Bosun. You should describe your desired templates, alerts, macros, etc through this configuration option. diff --git a/nixpkgs/nixos/modules/services/monitoring/cadvisor.nix b/nixpkgs/nixos/modules/services/monitoring/cadvisor.nix index 68e6e8e40b31..6b0852cfe3ef 100644 --- a/nixpkgs/nixos/modules/services/monitoring/cadvisor.nix +++ b/nixpkgs/nixos/modules/services/monitoring/cadvisor.nix @@ -8,49 +8,49 @@ let in { options = { services.cadvisor = { - enable = mkEnableOption (lib.mdDoc "Cadvisor service"); + enable = mkEnableOption "Cadvisor service"; listenAddress = mkOption { default = "127.0.0.1"; type = types.str; - description = lib.mdDoc "Cadvisor listening host"; + description = "Cadvisor listening host"; }; port = mkOption { default = 8080; type = types.port; - description = lib.mdDoc "Cadvisor listening port"; + description = "Cadvisor listening port"; }; storageDriver = mkOption { default = null; type = types.nullOr types.str; example = "influxdb"; - description = lib.mdDoc "Cadvisor storage driver."; + description = "Cadvisor storage driver."; }; storageDriverHost = mkOption { default = "localhost:8086"; type = types.str; - description = lib.mdDoc "Cadvisor storage driver host."; + description = "Cadvisor storage driver host."; }; storageDriverDb = mkOption { default = "root"; type = types.str; - description = lib.mdDoc "Cadvisord storage driver database name."; + description = "Cadvisord storage driver database name."; }; storageDriverUser = mkOption { default = "root"; type = types.str; - description = lib.mdDoc "Cadvisor storage driver username."; + description = "Cadvisor storage driver username."; }; storageDriverPassword = mkOption { default = "root"; type = types.str; - description = lib.mdDoc '' + description = '' Cadvisor storage driver password. Warning: this password is stored in the world-readable Nix store. It's @@ -62,7 +62,7 @@ in { storageDriverPasswordFile = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' File that contains the cadvisor storage driver password. {option}`storageDriverPasswordFile` takes precedence over {option}`storageDriverPassword` @@ -78,13 +78,13 @@ in { storageDriverSecure = mkOption { default = false; type = types.bool; - description = lib.mdDoc "Cadvisor storage driver, enable secure communication."; + description = "Cadvisor storage driver, enable secure communication."; }; extraOptions = mkOption { type = types.listOf types.str; default = []; - description = lib.mdDoc '' + description = '' Additional cadvisor options. See <https://github.com/google/cadvisor/blob/master/docs/runtime_options.md> for available options. diff --git a/nixpkgs/nixos/modules/services/monitoring/cockpit.nix b/nixpkgs/nixos/modules/services/monitoring/cockpit.nix index 45389a3174e1..64e26ce4e127 100644 --- a/nixpkgs/nixos/modules/services/monitoring/cockpit.nix +++ b/nixpkgs/nixos/modules/services/monitoring/cockpit.nix @@ -2,12 +2,12 @@ let cfg = config.services.cockpit; - inherit (lib) types mkEnableOption mkOption mkIf mdDoc literalMD mkPackageOption; + inherit (lib) types mkEnableOption mkOption mkIf literalMD mkPackageOption; settingsFormat = pkgs.formats.ini {}; in { options = { services.cockpit = { - enable = mkEnableOption (mdDoc "Cockpit"); + enable = mkEnableOption "Cockpit"; package = mkPackageOption pkgs "Cockpit" { default = [ "cockpit" ]; @@ -18,7 +18,7 @@ in { default = {}; - description = mdDoc '' + description = '' Settings for cockpit that will be saved in /etc/cockpit/cockpit.conf. See the [documentation](https://cockpit-project.org/guide/latest/cockpit.conf.5.html), that is also available with `man cockpit.conf.5` for details. @@ -26,13 +26,13 @@ in { }; port = mkOption { - description = mdDoc "Port where cockpit will listen."; + description = "Port where cockpit will listen."; type = types.port; default = 9090; }; openFirewall = mkOption { - description = mdDoc "Open port for cockpit."; + description = "Open port for cockpit."; type = types.bool; default = false; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/collectd.nix b/nixpkgs/nixos/modules/services/monitoring/collectd.nix index 3e62ef422bad..fe9b1214e5c1 100644 --- a/nixpkgs/nixos/modules/services/monitoring/collectd.nix +++ b/nixpkgs/nixos/modules/services/monitoring/collectd.nix @@ -29,11 +29,11 @@ let in { options.services.collectd = with types; { - enable = mkEnableOption (lib.mdDoc "collectd agent"); + enable = mkEnableOption "collectd agent"; validateConfig = mkOption { default = true; - description = lib.mdDoc '' + description = '' Validate the syntax of collectd configuration file at build time. Disable this if you use the Include directive on files unavailable in the build sandbox, or when cross-compiling. @@ -45,7 +45,7 @@ in { buildMinimalPackage = mkOption { default = false; - description = lib.mdDoc '' + description = '' Build a minimal collectd package with only the configured `services.collectd.plugins` ''; type = bool; @@ -53,7 +53,7 @@ in { user = mkOption { default = "collectd"; - description = lib.mdDoc '' + description = '' User under which to run collectd. ''; type = nullOr str; @@ -61,7 +61,7 @@ in { dataDir = mkOption { default = "/var/lib/collectd"; - description = lib.mdDoc '' + description = '' Data directory for collectd agent. ''; type = path; @@ -69,7 +69,7 @@ in { autoLoadPlugin = mkOption { default = false; - description = lib.mdDoc '' + description = '' Enable plugin autoloading. ''; type = bool; @@ -77,7 +77,7 @@ in { include = mkOption { default = []; - description = lib.mdDoc '' + description = '' Additional paths to load config from. ''; type = listOf str; @@ -86,7 +86,7 @@ in { plugins = mkOption { default = {}; example = { cpu = ""; memory = ""; network = "Server 192.168.1.1 25826"; }; - description = lib.mdDoc '' + description = '' Attribute set of plugin names to plugin config segments ''; type = attrsOf lines; @@ -94,7 +94,7 @@ in { extraConfig = mkOption { default = ""; - description = lib.mdDoc '' + description = '' Extra configuration for collectd. Use mkBefore to add lines before the default config, and mkAfter to add them below. ''; diff --git a/nixpkgs/nixos/modules/services/monitoring/das_watchdog.nix b/nixpkgs/nixos/modules/services/monitoring/das_watchdog.nix index fd420b0c8a06..88ca3a9227d2 100644 --- a/nixpkgs/nixos/modules/services/monitoring/das_watchdog.nix +++ b/nixpkgs/nixos/modules/services/monitoring/das_watchdog.nix @@ -12,7 +12,7 @@ in { ###### interface options = { - services.das_watchdog.enable = mkEnableOption (lib.mdDoc "realtime watchdog"); + services.das_watchdog.enable = mkEnableOption "realtime watchdog"; }; ###### implementation diff --git a/nixpkgs/nixos/modules/services/monitoring/datadog-agent.nix b/nixpkgs/nixos/modules/services/monitoring/datadog-agent.nix index 7b07c80c8d7b..5ac98bdf0382 100644 --- a/nixpkgs/nixos/modules/services/monitoring/datadog-agent.nix +++ b/nixpkgs/nixos/modules/services/monitoring/datadog-agent.nix @@ -49,7 +49,7 @@ let }; in { options.services.datadog-agent = { - enable = mkEnableOption (lib.mdDoc "Datadog-agent v7 monitoring service"); + enable = mkEnableOption "Datadog-agent v7 monitoring service"; package = mkPackageOption pkgs "datadog-agent" { extraDescription = '' @@ -61,7 +61,7 @@ in { }; apiKeyFile = mkOption { - description = lib.mdDoc '' + description = '' Path to a file containing the Datadog API key to associate the agent with your account. ''; @@ -70,7 +70,7 @@ in { }; ddUrl = mkOption { - description = lib.mdDoc '' + description = '' Custom dd_url to configure the agent with. Useful if traffic to datadog needs to go through a proxy. Don't use this to point to another datadog site (EU) - use site instead. @@ -81,7 +81,7 @@ in { }; site = mkOption { - description = lib.mdDoc '' + description = '' The datadog site to point the agent towards. Set to datadoghq.eu to point it to their EU site. ''; @@ -91,21 +91,21 @@ in { }; tags = mkOption { - description = lib.mdDoc "The tags to mark this Datadog agent"; + description = "The tags to mark this Datadog agent"; example = [ "test" "service" ]; default = null; type = types.nullOr (types.listOf types.str); }; hostname = mkOption { - description = lib.mdDoc "The hostname to show in the Datadog dashboard (optional)"; + description = "The hostname to show in the Datadog dashboard (optional)"; default = null; example = "mymachine.mydomain"; type = types.nullOr types.str; }; logLevel = mkOption { - description = lib.mdDoc "Logging verbosity."; + description = "Logging verbosity."; default = null; type = types.nullOr (types.enum ["DEBUG" "INFO" "WARN" "ERROR"]); }; @@ -114,7 +114,7 @@ in { default = {}; type = types.attrs; - description = lib.mdDoc '' + description = '' Extra integrations from the Datadog core-integrations repository that should be built and included. @@ -136,14 +136,14 @@ in { extraConfig = mkOption { default = {}; type = types.attrs; - description = lib.mdDoc '' + description = '' Extra configuration options that will be merged into the main config file {file}`datadog.yaml`. ''; }; enableLiveProcessCollection = mkOption { - description = lib.mdDoc '' + description = '' Whether to enable the live process collection agent. ''; default = false; @@ -153,7 +153,7 @@ in { processAgentPackage = mkOption { default = pkgs.datadog-process-agent; defaultText = literalExpression "pkgs.datadog-process-agent"; - description = lib.mdDoc '' + description = '' Which DataDog v7 agent package to use. Note that the provided package is expected to have an overridable `pythonPackages`-attribute which configures the Python environment with the Datadog @@ -163,7 +163,7 @@ in { }; enableTraceAgent = mkOption { - description = lib.mdDoc '' + description = '' Whether to enable the trace agent. ''; default = false; @@ -171,7 +171,7 @@ in { }; checks = mkOption { - description = lib.mdDoc '' + description = '' Configuration for all Datadog checks. Keys of this attribute set will be used as the name of the check to create the appropriate configuration in `conf.d/$check.d/conf.yaml`. @@ -210,7 +210,7 @@ in { }; diskCheck = mkOption { - description = lib.mdDoc "Disk check config"; + description = "Disk check config"; type = types.attrs; default = { init_config = {}; @@ -219,7 +219,7 @@ in { }; networkCheck = mkOption { - description = lib.mdDoc "Network check config"; + description = "Network check config"; type = types.attrs; default = { init_config = {}; diff --git a/nixpkgs/nixos/modules/services/monitoring/do-agent.nix b/nixpkgs/nixos/modules/services/monitoring/do-agent.nix index c1788c640c23..4dfb6236727b 100644 --- a/nixpkgs/nixos/modules/services/monitoring/do-agent.nix +++ b/nixpkgs/nixos/modules/services/monitoring/do-agent.nix @@ -8,7 +8,7 @@ let in { options.services.do-agent = { - enable = mkEnableOption (lib.mdDoc "do-agent, the DigitalOcean droplet metrics agent"); + enable = mkEnableOption "do-agent, the DigitalOcean droplet metrics agent"; }; config = mkIf cfg.enable { diff --git a/nixpkgs/nixos/modules/services/monitoring/fusion-inventory.nix b/nixpkgs/nixos/modules/services/monitoring/fusion-inventory.nix index 7b28e8de1229..9b65c76ce02e 100644 --- a/nixpkgs/nixos/modules/services/monitoring/fusion-inventory.nix +++ b/nixpkgs/nixos/modules/services/monitoring/fusion-inventory.nix @@ -22,11 +22,11 @@ in { services.fusionInventory = { - enable = mkEnableOption (lib.mdDoc "Fusion Inventory Agent"); + enable = mkEnableOption "Fusion Inventory Agent"; servers = mkOption { type = types.listOf types.str; - description = lib.mdDoc '' + description = '' The urls of the OCS/GLPI servers to connect to. ''; }; @@ -34,7 +34,7 @@ in { extraConfig = mkOption { default = ""; type = types.lines; - description = lib.mdDoc '' + description = '' Configuration that is injected verbatim into the configuration file. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/goss.nix b/nixpkgs/nixos/modules/services/monitoring/goss.nix index 1b973bbbf45c..00246752a7cd 100644 --- a/nixpkgs/nixos/modules/services/monitoring/goss.nix +++ b/nixpkgs/nixos/modules/services/monitoring/goss.nix @@ -14,7 +14,7 @@ in { options = { services.goss = { - enable = lib.mkEnableOption (lib.mdDoc "Goss daemon"); + enable = lib.mkEnableOption "Goss daemon"; package = lib.mkPackageOption pkgs "goss" { }; @@ -26,7 +26,7 @@ in { GOSS_LOGLEVEL = "FATAL"; GOSS_LISTEN = ":8080"; }; - description = lib.mdDoc '' + description = '' Environment variables to set for the goss service. See <https://github.com/goss-org/goss/blob/master/docs/manual.md> @@ -46,7 +46,7 @@ in { running = true; }; }; - description = lib.mdDoc '' + description = '' The global options in `config` file in yaml format. Refer to <https://github.com/goss-org/goss/blob/master/docs/goss-json-schema.yaml> for schema. diff --git a/nixpkgs/nixos/modules/services/monitoring/grafana-agent.nix b/nixpkgs/nixos/modules/services/monitoring/grafana-agent.nix index e8d38a453176..655ec8ded1e0 100644 --- a/nixpkgs/nixos/modules/services/monitoring/grafana-agent.nix +++ b/nixpkgs/nixos/modules/services/monitoring/grafana-agent.nix @@ -11,12 +11,12 @@ in }; options.services.grafana-agent = { - enable = mkEnableOption (lib.mdDoc "grafana-agent"); + enable = mkEnableOption "grafana-agent"; package = mkPackageOption pkgs "grafana-agent" { }; credentials = mkOption { - description = lib.mdDoc '' + description = '' Credentials to load at service startup. Keys that are UPPER_SNAKE will be loaded as env vars. Values are absolute paths to the credentials. ''; type = types.attrsOf types.str; @@ -36,7 +36,7 @@ in type = with types; listOf str; default = [ ]; example = [ "-enable-features=integrations-next" "-disable-reporting" ]; - description = lib.mdDoc '' + description = '' Extra command-line flags passed to {command}`grafana-agent`. See <https://grafana.com/docs/agent/latest/static/configuration/flags/> @@ -44,7 +44,7 @@ in }; settings = mkOption { - description = lib.mdDoc '' + description = '' Configuration for {command}`grafana-agent`. See <https://grafana.com/docs/agent/latest/configuration/> diff --git a/nixpkgs/nixos/modules/services/monitoring/grafana-image-renderer.nix b/nixpkgs/nixos/modules/services/monitoring/grafana-image-renderer.nix index afe9eb4d7b95..e06720b15302 100644 --- a/nixpkgs/nixos/modules/services/monitoring/grafana-image-renderer.nix +++ b/nixpkgs/nixos/modules/services/monitoring/grafana-image-renderer.nix @@ -10,18 +10,18 @@ let configFile = format.generate "grafana-image-renderer-config.json" cfg.settings; in { options.services.grafana-image-renderer = { - enable = mkEnableOption (lib.mdDoc "grafana-image-renderer"); + enable = mkEnableOption "grafana-image-renderer"; chromium = mkOption { type = types.package; - description = lib.mdDoc '' + description = '' The chromium to use for image rendering. ''; }; - verbose = mkEnableOption (lib.mdDoc "verbosity for the service"); + verbose = mkEnableOption "verbosity for the service"; - provisionGrafana = mkEnableOption (lib.mdDoc "Grafana configuration for grafana-image-renderer"); + provisionGrafana = mkEnableOption "Grafana configuration for grafana-image-renderer"; settings = mkOption { type = types.submodule { @@ -32,14 +32,14 @@ in { port = mkOption { type = types.port; default = 8081; - description = lib.mdDoc '' + description = '' The TCP port to use for the rendering server. ''; }; logging.level = mkOption { type = types.enum [ "error" "warning" "info" "debug" ]; default = "info"; - description = lib.mdDoc '' + description = '' The log-level of the {file}`grafana-image-renderer.service`-unit. ''; }; @@ -48,21 +48,21 @@ in { width = mkOption { default = 1000; type = types.ints.positive; - description = lib.mdDoc '' + description = '' Width of the PNG used to display the alerting graph. ''; }; height = mkOption { default = 500; type = types.ints.positive; - description = lib.mdDoc '' + description = '' Height of the PNG used to display the alerting graph. ''; }; mode = mkOption { default = "default"; type = types.enum [ "default" "reusable" "clustered" ]; - description = lib.mdDoc '' + description = '' Rendering mode of `grafana-image-renderer`: - `default:` Creates on browser-instance @@ -77,7 +77,7 @@ in { args = mkOption { type = types.listOf types.str; default = [ "--no-sandbox" ]; - description = lib.mdDoc '' + description = '' List of CLI flags passed to `chromium`. ''; }; @@ -87,7 +87,7 @@ in { default = {}; - description = lib.mdDoc '' + description = '' Configuration attributes for `grafana-image-renderer`. See <https://github.com/grafana/grafana-image-renderer/blob/ce1f81438e5f69c7fd7c73ce08bab624c4c92e25/default.json> diff --git a/nixpkgs/nixos/modules/services/monitoring/grafana-reporter.nix b/nixpkgs/nixos/modules/services/monitoring/grafana-reporter.nix index eac304d63aa1..340ab7abd19b 100644 --- a/nixpkgs/nixos/modules/services/monitoring/grafana-reporter.nix +++ b/nixpkgs/nixos/modules/services/monitoring/grafana-reporter.nix @@ -7,40 +7,40 @@ let in { options.services.grafana_reporter = { - enable = mkEnableOption (lib.mdDoc "grafana_reporter"); + enable = mkEnableOption "grafana_reporter"; grafana = { protocol = mkOption { - description = lib.mdDoc "Grafana protocol."; + description = "Grafana protocol."; default = "http"; type = types.enum ["http" "https"]; }; addr = mkOption { - description = lib.mdDoc "Grafana address."; + description = "Grafana address."; default = "127.0.0.1"; type = types.str; }; port = mkOption { - description = lib.mdDoc "Grafana port."; + description = "Grafana port."; default = 3000; type = types.port; }; }; addr = mkOption { - description = lib.mdDoc "Listening address."; + description = "Listening address."; default = "127.0.0.1"; type = types.str; }; port = mkOption { - description = lib.mdDoc "Listening port."; + description = "Listening port."; default = 8686; type = types.port; }; templateDir = mkOption { - description = lib.mdDoc "Optional template directory to use custom tex templates"; + description = "Optional template directory to use custom tex templates"; default = pkgs.grafana_reporter; defaultText = literalExpression "pkgs.grafana_reporter"; type = types.either types.str types.path; diff --git a/nixpkgs/nixos/modules/services/monitoring/grafana.nix b/nixpkgs/nixos/modules/services/monitoring/grafana.nix index 5ac010bf81ee..9d453c539482 100644 --- a/nixpkgs/nixos/modules/services/monitoring/grafana.nix +++ b/nixpkgs/nixos/modules/services/monitoring/grafana.nix @@ -95,41 +95,41 @@ let options = { name = mkOption { type = types.str; - description = lib.mdDoc "Name of the datasource. Required."; + description = "Name of the datasource. Required."; }; type = mkOption { type = types.str; - description = lib.mdDoc "Datasource type. Required."; + description = "Datasource type. Required."; }; access = mkOption { type = types.enum [ "proxy" "direct" ]; default = "proxy"; - description = lib.mdDoc "Access mode. proxy or direct (Server or Browser in the UI). Required."; + description = "Access mode. proxy or direct (Server or Browser in the UI). Required."; }; uid = mkOption { type = types.nullOr types.str; default = null; - description = lib.mdDoc "Custom UID which can be used to reference this datasource in other parts of the configuration, if not specified will be generated automatically."; + description = "Custom UID which can be used to reference this datasource in other parts of the configuration, if not specified will be generated automatically."; }; url = mkOption { type = types.str; default = "localhost"; - description = lib.mdDoc "Url of the datasource."; + description = "Url of the datasource."; }; editable = mkOption { type = types.bool; default = false; - description = lib.mdDoc "Allow users to edit datasources from the UI."; + description = "Allow users to edit datasources from the UI."; }; jsonData = mkOption { type = types.nullOr types.attrs; default = null; - description = lib.mdDoc "Extra data for datasource plugins."; + description = "Extra data for datasource plugins."; }; secureJsonData = mkOption { type = types.nullOr types.attrs; default = null; - description = lib.mdDoc '' + description = '' 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 @@ -148,16 +148,16 @@ let name = mkOption { type = types.str; default = "default"; - description = lib.mdDoc "A unique provider name."; + description = "A unique provider name."; }; type = mkOption { type = types.str; default = "file"; - description = lib.mdDoc "Dashboard provider type."; + description = "Dashboard provider type."; }; options.path = mkOption { type = types.path; - description = lib.mdDoc "Path grafana will watch for dashboards. Required when using the 'file' type."; + description = "Path grafana will watch for dashboards. Required when using the 'file' type."; }; }; }; @@ -167,55 +167,55 @@ let name = mkOption { type = types.str; default = "default"; - description = lib.mdDoc "Notifier name."; + description = "Notifier name."; }; type = mkOption { type = types.enum [ "dingding" "discord" "email" "googlechat" "hipchat" "kafka" "line" "teams" "opsgenie" "pagerduty" "prometheus-alertmanager" "pushover" "sensu" "sensugo" "slack" "telegram" "threema" "victorops" "webhook" ]; - description = lib.mdDoc "Notifier type."; + description = "Notifier type."; }; uid = mkOption { type = types.str; - description = lib.mdDoc "Unique notifier identifier."; + description = "Unique notifier identifier."; }; org_id = mkOption { type = types.int; default = 1; - description = lib.mdDoc "Organization ID."; + description = "Organization ID."; }; org_name = mkOption { type = types.str; default = "Main Org."; - description = lib.mdDoc "Organization name."; + description = "Organization name."; }; is_default = mkOption { type = types.bool; - description = lib.mdDoc "Is the default notifier."; + description = "Is the default notifier."; default = false; }; send_reminder = mkOption { type = types.bool; default = true; - description = lib.mdDoc "Should the notifier be sent reminder notifications while alerts continue to fire."; + description = "Should the notifier be sent reminder notifications while alerts continue to fire."; }; frequency = mkOption { type = types.str; default = "5m"; - description = lib.mdDoc "How frequently should the notifier be sent reminders."; + description = "How frequently should the notifier be sent reminders."; }; disable_resolve_message = mkOption { type = types.bool; default = false; - description = lib.mdDoc "Turn off the message that sends when an alert returns to OK."; + description = "Turn off the message that sends when an alert returns to OK."; }; settings = mkOption { type = types.nullOr types.attrs; default = null; - description = lib.mdDoc "Settings for the notifier type."; + description = "Settings for the notifier type."; }; secure_settings = mkOption { type = types.nullOr types.attrs; default = null; - description = lib.mdDoc '' + description = '' Secure settings for the notifier type. 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 @@ -297,12 +297,12 @@ in ]; options.services.grafana = { - enable = mkEnableOption (lib.mdDoc "grafana"); + enable = mkEnableOption "grafana"; declarativePlugins = mkOption { type = with types; nullOr (listOf path); default = null; - description = lib.mdDoc "If non-null, then a list of packages containing Grafana plugins to install. If set, plugins cannot be manually installed."; + description = "If non-null, then a list of packages containing Grafana plugins to install. If set, plugins cannot be manually installed."; example = literalExpression "with pkgs.grafanaPlugins; [ grafana-piechart-panel ]"; # Make sure each plugin is added only once; otherwise building # the link farm fails, since the same path is added multiple @@ -313,13 +313,13 @@ in package = mkPackageOption pkgs "grafana" { }; dataDir = mkOption { - description = lib.mdDoc "Data directory."; + description = "Data directory."; default = "/var/lib/grafana"; type = types.path; }; settings = mkOption { - description = lib.mdDoc '' + description = '' Grafana settings. See <https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/> for available options. INI format is used. ''; @@ -329,14 +329,14 @@ in options = { paths = { plugins = mkOption { - description = lib.mdDoc "Directory where grafana will automatically scan and look for plugins"; + description = "Directory where grafana will automatically scan and look for plugins"; default = if (cfg.declarativePlugins == null) then "${cfg.dataDir}/plugins" else declarativePlugins; defaultText = literalExpression "if (cfg.declarativePlugins == null) then \"\${cfg.dataDir}/plugins\" else declarativePlugins"; type = types.path; }; provisioning = mkOption { - description = lib.mdDoc '' + description = '' 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. ''; @@ -348,7 +348,7 @@ in server = { protocol = mkOption { - description = lib.mdDoc "Which protocol to listen."; + description = "Which protocol to listen."; default = "http"; type = types.enum [ "http" "https" "h2" "socket" ]; }; @@ -356,7 +356,7 @@ in http_addr = mkOption { type = types.str; default = "127.0.0.1"; - description = lib.mdDoc '' + description = '' Listening address. ::: {.note} @@ -366,13 +366,13 @@ in }; http_port = mkOption { - description = lib.mdDoc "Listening port."; + description = "Listening port."; default = 3000; type = types.port; }; domain = mkOption { - description = lib.mdDoc '' + description = '' 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. @@ -383,7 +383,7 @@ in }; enforce_domain = mkOption { - description = lib.mdDoc '' + description = '' Redirect to correct domain if the host header does not match the domain. Prevents DNS rebinding attacks. ''; @@ -392,7 +392,7 @@ in }; root_url = mkOption { - description = lib.mdDoc '' + description = '' 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). @@ -404,7 +404,7 @@ in }; serve_from_sub_path = mkOption { - description = lib.mdDoc '' + description = '' Serve Grafana from subpath specified in the `root_url` setting. By default it is set to `false` for compatibility reasons. @@ -418,7 +418,7 @@ in }; router_logging = mkOption { - description = lib.mdDoc '' + description = '' Set to `true` for Grafana to log all HTTP requests (not just errors). These are logged as Info level events to the Grafana log. ''; @@ -427,14 +427,14 @@ in }; static_root_path = mkOption { - description = lib.mdDoc "Root path for static assets."; + description = "Root path for static assets."; default = "${cfg.package}/share/grafana/public"; defaultText = literalExpression ''"''${package}/share/grafana/public"''; type = types.str; }; enable_gzip = mkOption { - description = lib.mdDoc '' + description = '' 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. ''; @@ -443,7 +443,7 @@ in }; cert_file = mkOption { - description = lib.mdDoc '' + description = '' Path to the certificate file (if `protocol` is set to `https` or `h2`). ''; default = null; @@ -451,7 +451,7 @@ in }; cert_key = mkOption { - description = lib.mdDoc '' + description = '' Path to the certificate key file (if `protocol` is set to `https` or `h2`). ''; default = null; @@ -459,7 +459,7 @@ in }; socket_gid = mkOption { - description = lib.mdDoc '' + description = '' 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. @@ -470,7 +470,7 @@ in }; socket_mode = mkOption { - description = lib.mdDoc '' + description = '' Mode where the socket should be set when `protocol=socket`. Make sure that Grafana process is the file owner before you change this setting. ''; @@ -482,7 +482,7 @@ in }; socket = mkOption { - description = lib.mdDoc '' + description = '' Path where the socket should be created when `protocol=socket`. Make sure that Grafana has appropriate permissions before you change this setting. ''; @@ -491,7 +491,7 @@ in }; cdn_url = mkOption { - description = lib.mdDoc '' + description = '' Specify a full HTTP URL address to the root of your Grafana CDN assets. Grafana will add edition and version paths. @@ -503,7 +503,7 @@ in }; read_timeout = mkOption { - description = lib.mdDoc '' + description = '' 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. @@ -515,13 +515,13 @@ in database = { type = mkOption { - description = lib.mdDoc "Database type."; + description = "Database type."; default = "sqlite3"; type = types.enum [ "mysql" "sqlite3" "postgres" ]; }; host = mkOption { - description = lib.mdDoc '' + description = '' 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"` @@ -532,19 +532,19 @@ in }; name = mkOption { - description = lib.mdDoc "The name of the Grafana database."; + description = "The name of the Grafana database."; default = "grafana"; type = types.str; }; user = mkOption { - description = lib.mdDoc "The database user (not applicable for `sqlite3`)."; + description = "The database user (not applicable for `sqlite3`)."; default = "root"; type = types.str; }; password = mkOption { - description = lib.mdDoc '' + description = '' The database user's password (not applicable for `sqlite3`). Please note that the contents of this option @@ -558,19 +558,19 @@ in }; max_idle_conn = mkOption { - description = lib.mdDoc "The maximum number of connections in the idle connection pool."; + description = "The maximum number of connections in the idle connection pool."; default = 2; type = types.int; }; max_open_conn = mkOption { - description = lib.mdDoc "The maximum number of open connections to the database."; + description = "The maximum number of open connections to the database."; default = 0; type = types.int; }; conn_max_lifetime = mkOption { - description = lib.mdDoc '' + description = '' 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. @@ -580,7 +580,7 @@ in }; locking_attempt_timeout_sec = mkOption { - description = lib.mdDoc '' + description = '' 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. ''; @@ -589,13 +589,13 @@ in }; log_queries = mkOption { - description = lib.mdDoc "Set to `true` to log the sql calls and execution times"; + description = "Set to `true` to log the sql calls and execution times"; default = false; type = types.bool; }; ssl_mode = mkOption { - description = lib.mdDoc '' + description = '' For Postgres, use either `disable`, `require` or `verify-full`. For MySQL, use either `true`, `false`, or `skip-verify`. ''; @@ -604,7 +604,7 @@ in }; isolation_level = mkOption { - description = lib.mdDoc '' + description = '' Only the MySQL driver supports isolation levels in Grafana. In case the value is empty, the driver's default isolation level is applied. ''; @@ -613,25 +613,25 @@ in }; ca_cert_path = mkOption { - description = lib.mdDoc "The path to the CA certificate to use."; + description = "The path to the CA certificate to use."; default = null; type = types.nullOr types.str; }; client_key_path = mkOption { - description = lib.mdDoc "The path to the client key. Only if server requires client authentication."; + description = "The path to the client key. Only if server requires client authentication."; default = null; type = types.nullOr types.str; }; client_cert_path = mkOption { - description = lib.mdDoc "The path to the client cert. Only if server requires client authentication."; + description = "The path to the client cert. Only if server requires client authentication."; default = null; type = types.nullOr types.str; }; server_cert_name = mkOption { - description = lib.mdDoc '' + description = '' The common name field of the certificate used by the `mysql` or `postgres` server. Not necessary if `ssl_mode` is set to `skip-verify`. ''; @@ -640,14 +640,14 @@ in }; path = mkOption { - description = lib.mdDoc "Only applicable to `sqlite3` database. The file path where the database will be stored."; + description = "Only applicable to `sqlite3` database. The file path where the database will be stored."; default = "${cfg.dataDir}/data/grafana.db"; defaultText = literalExpression ''"''${config.${opt.dataDir}}/data/grafana.db"''; type = types.path; }; cache_mode = mkOption { - description = lib.mdDoc '' + description = '' For `sqlite3` only. [Shared cache](https://www.sqlite.org/sharedcache.html) setting used for connecting to the database. ''; @@ -656,7 +656,7 @@ in }; wal = mkOption { - description = lib.mdDoc '' + description = '' For `sqlite3` only. Setting to enable/disable [Write-Ahead Logging](https://sqlite.org/wal.html). ''; @@ -665,7 +665,7 @@ in }; query_retries = mkOption { - description = lib.mdDoc '' + description = '' This setting applies to `sqlite3` only and controls the number of times the system retries a query when the database is locked. ''; default = 0; @@ -673,7 +673,7 @@ in }; transaction_retries = mkOption { - description = lib.mdDoc '' + description = '' This setting applies to `sqlite3` only and controls the number of times the system retries a transaction when the database is locked. ''; default = 5; @@ -682,7 +682,7 @@ in # TODO Add "instrument_queries" option when upgrading to grafana 10.0 # instrument_queries = mkOption { - # description = lib.mdDoc "Set to `true` to add metrics and tracing for database queries."; + # description = "Set to `true` to add metrics and tracing for database queries."; # default = false; # type = types.bool; # }; @@ -690,19 +690,19 @@ in security = { disable_initial_admin_creation = mkOption { - description = lib.mdDoc "Disable creation of admin user on first start of Grafana."; + description = "Disable creation of admin user on first start of Grafana."; default = false; type = types.bool; }; admin_user = mkOption { - description = lib.mdDoc "Default admin username."; + description = "Default admin username."; default = "admin"; type = types.str; }; admin_password = mkOption { - description = lib.mdDoc '' + description = '' 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 @@ -714,13 +714,13 @@ in }; admin_email = mkOption { - description = lib.mdDoc "The email of the default Grafana Admin, created on startup."; + description = "The email of the default Grafana Admin, created on startup."; default = "admin@localhost"; type = types.str; }; secret_key = mkOption { - description = lib.mdDoc '' + description = '' 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 @@ -732,13 +732,13 @@ in }; disable_gravatar = mkOption { - description = lib.mdDoc "Set to `true` to disable the use of Gravatar for user profile images."; + description = "Set to `true` to disable the use of Gravatar for user profile images."; default = false; type = types.bool; }; data_source_proxy_whitelist = mkOption { - description = lib.mdDoc '' + description = '' 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. @@ -749,19 +749,19 @@ in }; disable_brute_force_login_protection = mkOption { - description = lib.mdDoc "Set to `true` to disable [brute force login protection](https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html#account-lockout)."; + description = "Set to `true` to disable [brute force login protection](https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html#account-lockout)."; default = false; type = types.bool; }; cookie_secure = mkOption { - description = lib.mdDoc "Set to `true` if you host Grafana behind HTTPS."; + description = "Set to `true` if you host Grafana behind HTTPS."; default = false; type = types.bool; }; cookie_samesite = mkOption { - description = lib.mdDoc '' + description = '' 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), @@ -773,7 +773,7 @@ in }; allow_embedding = mkOption { - description = lib.mdDoc '' + description = '' 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](https://owasp.org/www-community/attacks/Clickjacking). @@ -783,7 +783,7 @@ in }; strict_transport_security = mkOption { - description = lib.mdDoc '' + description = '' 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). @@ -794,7 +794,7 @@ in }; strict_transport_security_max_age_seconds = mkOption { - description = lib.mdDoc '' + description = '' Sets how long a browser should cache HSTS in seconds. Only applied if `strict_transport_security` is enabled. ''; @@ -803,7 +803,7 @@ in }; strict_transport_security_preload = mkOption { - description = lib.mdDoc '' + description = '' Set to `true` to enable HSTS `preloading` option. Only applied if `strict_transport_security` is enabled. ''; @@ -812,7 +812,7 @@ in }; strict_transport_security_subdomains = mkOption { - description = lib.mdDoc '' + description = '' Set to `true` to enable HSTS `includeSubDomains` option. Only applied if `strict_transport_security` is enabled. ''; @@ -821,7 +821,7 @@ in }; x_content_type_options = mkOption { - description = lib.mdDoc '' + description = '' 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. @@ -831,7 +831,7 @@ in }; x_xss_protection = mkOption { - description = lib.mdDoc '' + description = '' 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. ''; @@ -840,7 +840,7 @@ in }; content_security_policy = mkOption { - description = lib.mdDoc '' + description = '' 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. ''; @@ -849,7 +849,7 @@ in }; content_security_policy_report_only = mkOption { - description = lib.mdDoc '' + description = '' 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. @@ -868,7 +868,7 @@ in # https://github.com/grafana/grafana/blob/916d9793aa81c2990640b55a15dee0db6b525e41/pkg/middleware/csrf/csrf.go#L37-L38 csrf_trusted_origins = mkOption { - description = lib.mdDoc '' + description = '' List of additional allowed URLs to pass by the CSRF check. Suggested when authentication comes from an IdP. ''; @@ -877,7 +877,7 @@ in }; csrf_additional_headers = mkOption { - description = lib.mdDoc '' + description = '' List of allowed headers to be set by the user. Suggested to use for if authentication lives behind reverse proxies. ''; @@ -888,25 +888,25 @@ in smtp = { enabled = mkOption { - description = lib.mdDoc "Whether to enable SMTP."; + description = "Whether to enable SMTP."; default = false; type = types.bool; }; host = mkOption { - description = lib.mdDoc "Host to connect to."; + description = "Host to connect to."; default = "localhost:25"; type = types.str; }; user = mkOption { - description = lib.mdDoc "User used for authentication."; + description = "User used for authentication."; default = null; type = types.nullOr types.str; }; password = mkOption { - description = lib.mdDoc '' + description = '' 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 @@ -918,43 +918,43 @@ in }; cert_file = mkOption { - description = lib.mdDoc "File path to a cert file."; + description = "File path to a cert file."; default = null; type = types.nullOr types.str; }; key_file = mkOption { - description = lib.mdDoc "File path to a key file."; + description = "File path to a key file."; default = null; type = types.nullOr types.str; }; skip_verify = mkOption { - description = lib.mdDoc "Verify SSL for SMTP server."; + description = "Verify SSL for SMTP server."; default = false; type = types.bool; }; from_address = mkOption { - description = lib.mdDoc "Address used when sending out emails."; + description = "Address used when sending out emails."; default = "admin@grafana.localhost"; type = types.str; }; from_name = mkOption { - description = lib.mdDoc "Name to be used as client identity for EHLO in SMTP dialog."; + description = "Name to be used as client identity for EHLO in SMTP dialog."; default = "Grafana"; type = types.str; }; ehlo_identity = mkOption { - description = lib.mdDoc "Name to be used as client identity for EHLO in SMTP dialog."; + description = "Name to be used as client identity for EHLO in SMTP dialog."; default = null; type = types.nullOr types.str; }; startTLS_policy = mkOption { - description = lib.mdDoc "StartTLS policy when connecting to server."; + description = "StartTLS policy when connecting to server."; default = null; type = types.nullOr (types.enum [ "OpportunisticStartTLS" "MandatoryStartTLS" "NoStartTLS" ]); }; @@ -962,7 +962,7 @@ in users = { allow_sign_up = mkOption { - description = lib.mdDoc '' + description = '' Set to false to prohibit users from being able to sign up / create user accounts. The admin user can still create users. ''; @@ -971,13 +971,13 @@ in }; allow_org_create = mkOption { - description = lib.mdDoc "Set to `false` to prohibit users from creating new organizations."; + description = "Set to `false` to prohibit users from creating new organizations."; default = false; type = types.bool; }; auto_assign_org = mkOption { - description = lib.mdDoc '' + description = '' 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`. @@ -987,7 +987,7 @@ in }; auto_assign_org_id = mkOption { - description = lib.mdDoc '' + description = '' 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. @@ -997,7 +997,7 @@ in }; auto_assign_org_role = mkOption { - description = lib.mdDoc '' + description = '' The role new users will be assigned for the main organization (if the `auto_assign_org` setting is set to `true`). ''; default = "Viewer"; @@ -1005,37 +1005,37 @@ in }; verify_email_enabled = mkOption { - description = lib.mdDoc "Require email validation before sign up completes."; + description = "Require email validation before sign up completes."; default = false; type = types.bool; }; login_hint = mkOption { - description = lib.mdDoc "Text used as placeholder text on login page for login/username input."; + description = "Text used as placeholder text on login page for login/username input."; default = "email or username"; type = types.str; }; password_hint = mkOption { - description = lib.mdDoc "Text used as placeholder text on login page for password input."; + description = "Text used as placeholder text on login page for password input."; default = "password"; type = types.str; }; default_theme = mkOption { - description = lib.mdDoc "Sets the default UI theme. `system` matches the user's system theme."; + description = "Sets the default UI theme. `system` matches the user's system theme."; default = "dark"; type = types.enum [ "dark" "light" "system" ]; }; default_language = mkOption { - description = lib.mdDoc "This setting configures the default UI language, which must be a supported IETF language tag, such as `en-US`."; + description = "This setting configures the default UI language, which must be a supported IETF language tag, such as `en-US`."; default = "en-US"; type = types.str; }; home_page = mkOption { - description = lib.mdDoc '' + description = '' 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. @@ -1045,7 +1045,7 @@ in }; viewers_can_edit = mkOption { - description = lib.mdDoc '' + description = '' Viewers can access and use Explore and perform temporary edits on panels in dashboards they have access to. They cannot save their changes. ''; @@ -1054,13 +1054,13 @@ in }; editors_can_admin = mkOption { - description = lib.mdDoc "Editors can administrate dashboards, folders and teams they create."; + description = "Editors can administrate dashboards, folders and teams they create."; default = false; type = types.bool; }; user_invite_max_lifetime_duration = mkOption { - description = lib.mdDoc '' + description = '' 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). @@ -1073,7 +1073,7 @@ in # Lists are joined via space, so this option can't be a list. # Users have to manually join their values. hidden_users = mkOption { - description = lib.mdDoc '' + description = '' 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. @@ -1085,7 +1085,7 @@ in analytics = { reporting_enabled = mkOption { - description = lib.mdDoc '' + description = '' 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. @@ -1095,7 +1095,7 @@ in }; check_for_updates = mkOption { - description = lib.mdDoc '' + description = '' 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. @@ -1106,7 +1106,7 @@ in }; check_for_plugin_updates = mkOption { - description = lib.mdDoc '' + description = '' 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. @@ -1118,7 +1118,7 @@ in }; feedback_links_enabled = mkOption { - description = lib.mdDoc "Set to `false` to remove all feedback links from the UI."; + description = "Set to `false` to remove all feedback links from the UI."; default = true; type = types.bool; }; @@ -1128,16 +1128,16 @@ in }; provision = { - enable = mkEnableOption (lib.mdDoc "provision"); + enable = mkEnableOption "provision"; datasources = mkOption { - description = lib.mdDoc '' + description = '' Declaratively provision Grafana's datasources. ''; default = { }; type = types.submodule { options.settings = mkOption { - description = lib.mdDoc '' + description = '' Grafana datasource configuration in Nix. Can't be used with [](#opt-services.grafana.provision.datasources.path) simultaneously. See <https://grafana.com/docs/grafana/latest/administration/provisioning/#data-sources> @@ -1147,28 +1147,28 @@ in type = types.nullOr (types.submodule { options = { apiVersion = mkOption { - description = lib.mdDoc "Config file version."; + description = "Config file version."; default = 1; type = types.int; }; datasources = mkOption { - description = lib.mdDoc "List of datasources to insert/update."; + description = "List of datasources to insert/update."; default = [ ]; type = types.listOf grafanaTypes.datasourceConfig; }; deleteDatasources = mkOption { - description = lib.mdDoc "List of datasources that should be deleted from the database."; + description = "List of datasources that should be deleted from the database."; default = [ ]; type = types.listOf (types.submodule { options.name = mkOption { - description = lib.mdDoc "Name of the datasource to delete."; + description = "Name of the datasource to delete."; type = types.str; }; options.orgId = mkOption { - description = lib.mdDoc "Organization ID of the datasource to delete."; + description = "Organization ID of the datasource to delete."; type = types.int; }; }); @@ -1193,7 +1193,7 @@ in }; options.path = mkOption { - description = lib.mdDoc '' + description = '' Path to YAML datasource configuration. Can't be used with [](#opt-services.grafana.provision.datasources.settings) simultaneously. Can be either a directory or a single YAML file. Will end up in the store. @@ -1206,13 +1206,13 @@ in dashboards = mkOption { - description = lib.mdDoc '' + description = '' Declaratively provision Grafana's dashboards. ''; default = { }; type = types.submodule { options.settings = mkOption { - description = lib.mdDoc '' + description = '' Grafana dashboard configuration in Nix. Can't be used with [](#opt-services.grafana.provision.dashboards.path) simultaneously. See <https://grafana.com/docs/grafana/latest/administration/provisioning/#dashboards> @@ -1221,13 +1221,13 @@ in default = null; type = types.nullOr (types.submodule { options.apiVersion = mkOption { - description = lib.mdDoc "Config file version."; + description = "Config file version."; default = 1; type = types.int; }; options.providers = mkOption { - description = lib.mdDoc "List of dashboards to insert/update."; + description = "List of dashboards to insert/update."; default = [ ]; type = types.listOf grafanaTypes.dashboardConfig; }; @@ -1245,7 +1245,7 @@ in }; options.path = mkOption { - description = lib.mdDoc '' + description = '' Path to YAML dashboard configuration. Can't be used with [](#opt-services.grafana.provision.dashboards.settings) simultaneously. Can be either a directory or a single YAML file. Will end up in the store. @@ -1258,7 +1258,7 @@ in notifiers = mkOption { - description = lib.mdDoc "Grafana notifier configuration."; + description = "Grafana notifier configuration."; default = [ ]; type = types.listOf grafanaTypes.notifierConfig; apply = x: map _filter x; @@ -1268,7 +1268,7 @@ in alerting = { rules = { path = mkOption { - description = lib.mdDoc '' + description = '' Path to YAML rules configuration. Can't be used with [](#opt-services.grafana.provision.alerting.rules.settings) simultaneously. Can be either a directory or a single YAML file. Will end up in the store. @@ -1278,7 +1278,7 @@ in }; settings = mkOption { - description = lib.mdDoc '' + description = '' Grafana rules configuration in Nix. Can't be used with [](#opt-services.grafana.provision.alerting.rules.path) simultaneously. See <https://grafana.com/docs/grafana/latest/administration/provisioning/#rules> @@ -1288,46 +1288,46 @@ in type = types.nullOr (types.submodule { options = { apiVersion = mkOption { - description = lib.mdDoc "Config file version."; + description = "Config file version."; default = 1; type = types.int; }; groups = mkOption { - description = lib.mdDoc "List of rule groups to import or update."; + description = "List of rule groups to import or update."; default = [ ]; type = types.listOf (types.submodule { freeformType = provisioningSettingsFormat.type; options.name = mkOption { - description = lib.mdDoc "Name of the rule group. Required."; + description = "Name of the rule group. Required."; type = types.str; }; options.folder = mkOption { - description = lib.mdDoc "Name of the folder the rule group will be stored in. Required."; + description = "Name of the folder the rule group will be stored in. Required."; type = types.str; }; options.interval = mkOption { - description = lib.mdDoc "Interval that the rule group should be evaluated at. Required."; + description = "Interval that the rule group should be evaluated at. Required."; type = types.str; }; }); }; deleteRules = mkOption { - description = lib.mdDoc "List of alert rule UIDs that should be deleted."; + description = "List of alert rule UIDs that should be deleted."; default = [ ]; type = types.listOf (types.submodule { options.orgId = mkOption { - description = lib.mdDoc "Organization ID, default = 1"; + description = "Organization ID, default = 1"; default = 1; type = types.int; }; options.uid = mkOption { - description = lib.mdDoc "Unique identifier for the rule. Required."; + description = "Unique identifier for the rule. Required."; type = types.str; }; }); @@ -1392,7 +1392,7 @@ in contactPoints = { path = mkOption { - description = lib.mdDoc '' + description = '' Path to YAML contact points configuration. Can't be used with [](#opt-services.grafana.provision.alerting.contactPoints.settings) simultaneously. Can be either a directory or a single YAML file. Will end up in the store. @@ -1402,7 +1402,7 @@ in }; settings = mkOption { - description = lib.mdDoc '' + description = '' Grafana contact points configuration in Nix. Can't be used with [](#opt-services.grafana.provision.alerting.contactPoints.path) simultaneously. See <https://grafana.com/docs/grafana/latest/administration/provisioning/#contact-points> @@ -1412,36 +1412,36 @@ in type = types.nullOr (types.submodule { options = { apiVersion = mkOption { - description = lib.mdDoc "Config file version."; + description = "Config file version."; default = 1; type = types.int; }; contactPoints = mkOption { - description = lib.mdDoc "List of contact points to import or update."; + description = "List of contact points to import or update."; default = [ ]; type = types.listOf (types.submodule { freeformType = provisioningSettingsFormat.type; options.name = mkOption { - description = lib.mdDoc "Name of the contact point. Required."; + description = "Name of the contact point. Required."; type = types.str; }; }); }; deleteContactPoints = mkOption { - description = lib.mdDoc "List of receivers that should be deleted."; + description = "List of receivers that should be deleted."; default = [ ]; type = types.listOf (types.submodule { options.orgId = mkOption { - description = lib.mdDoc "Organization ID, default = 1."; + description = "Organization ID, default = 1."; default = 1; type = types.int; }; options.uid = mkOption { - description = lib.mdDoc "Unique identifier for the receiver. Required."; + description = "Unique identifier for the receiver. Required."; type = types.str; }; }); @@ -1473,7 +1473,7 @@ in policies = { path = mkOption { - description = lib.mdDoc '' + description = '' Path to YAML notification policies configuration. Can't be used with [](#opt-services.grafana.provision.alerting.policies.settings) simultaneously. Can be either a directory or a single YAML file. Will end up in the store. @@ -1483,7 +1483,7 @@ in }; settings = mkOption { - description = lib.mdDoc '' + description = '' Grafana notification policies configuration in Nix. Can't be used with [](#opt-services.grafana.provision.alerting.policies.path) simultaneously. See <https://grafana.com/docs/grafana/latest/administration/provisioning/#notification-policies> @@ -1493,13 +1493,13 @@ in type = types.nullOr (types.submodule { options = { apiVersion = mkOption { - description = lib.mdDoc "Config file version."; + description = "Config file version."; default = 1; type = types.int; }; policies = mkOption { - description = lib.mdDoc "List of contact points to import or update."; + description = "List of contact points to import or update."; default = [ ]; type = types.listOf (types.submodule { freeformType = provisioningSettingsFormat.type; @@ -1507,7 +1507,7 @@ in }; resetPolicies = mkOption { - description = lib.mdDoc "List of orgIds that should be reset to the default policy."; + description = "List of orgIds that should be reset to the default policy."; default = [ ]; type = types.listOf types.int; }; @@ -1543,7 +1543,7 @@ in templates = { path = mkOption { - description = lib.mdDoc '' + description = '' Path to YAML templates configuration. Can't be used with [](#opt-services.grafana.provision.alerting.templates.settings) simultaneously. Can be either a directory or a single YAML file. Will end up in the store. @@ -1553,7 +1553,7 @@ in }; settings = mkOption { - description = lib.mdDoc '' + description = '' Grafana templates configuration in Nix. Can't be used with [](#opt-services.grafana.provision.alerting.templates.path) simultaneously. See <https://grafana.com/docs/grafana/latest/administration/provisioning/#templates> @@ -1563,41 +1563,41 @@ in type = types.nullOr (types.submodule { options = { apiVersion = mkOption { - description = lib.mdDoc "Config file version."; + description = "Config file version."; default = 1; type = types.int; }; templates = mkOption { - description = lib.mdDoc "List of templates to import or update."; + description = "List of templates to import or update."; default = [ ]; type = types.listOf (types.submodule { freeformType = provisioningSettingsFormat.type; options.name = mkOption { - description = lib.mdDoc "Name of the template, must be unique. Required."; + description = "Name of the template, must be unique. Required."; type = types.str; }; options.template = mkOption { - description = lib.mdDoc "Alerting with a custom text template"; + description = "Alerting with a custom text template"; type = types.str; }; }); }; deleteTemplates = mkOption { - description = lib.mdDoc "List of alert rule UIDs that should be deleted."; + description = "List of alert rule UIDs that should be deleted."; default = [ ]; type = types.listOf (types.submodule { options.orgId = mkOption { - description = lib.mdDoc "Organization ID, default = 1."; + description = "Organization ID, default = 1."; default = 1; type = types.int; }; options.name = mkOption { - description = lib.mdDoc "Name of the template, must be unique. Required."; + description = "Name of the template, must be unique. Required."; type = types.str; }; }); @@ -1625,7 +1625,7 @@ in muteTimings = { path = mkOption { - description = lib.mdDoc '' + description = '' Path to YAML mute timings configuration. Can't be used with [](#opt-services.grafana.provision.alerting.muteTimings.settings) simultaneously. Can be either a directory or a single YAML file. Will end up in the store. @@ -1635,7 +1635,7 @@ in }; settings = mkOption { - description = lib.mdDoc '' + description = '' Grafana mute timings configuration in Nix. Can't be used with [](#opt-services.grafana.provision.alerting.muteTimings.path) simultaneously. See <https://grafana.com/docs/grafana/latest/administration/provisioning/#mute-timings> @@ -1645,36 +1645,36 @@ in type = types.nullOr (types.submodule { options = { apiVersion = mkOption { - description = lib.mdDoc "Config file version."; + description = "Config file version."; default = 1; type = types.int; }; muteTimes = mkOption { - description = lib.mdDoc "List of mute time intervals to import or update."; + description = "List of mute time intervals to import or update."; default = [ ]; type = types.listOf (types.submodule { freeformType = provisioningSettingsFormat.type; options.name = mkOption { - description = lib.mdDoc "Name of the mute time interval, must be unique. Required."; + description = "Name of the mute time interval, must be unique. Required."; type = types.str; }; }); }; deleteMuteTimes = mkOption { - description = lib.mdDoc "List of mute time intervals that should be deleted."; + description = "List of mute time intervals that should be deleted."; default = [ ]; type = types.listOf (types.submodule { options.orgId = mkOption { - description = lib.mdDoc "Organization ID, default = 1."; + description = "Organization ID, default = 1."; default = 1; type = types.int; }; options.name = mkOption { - description = lib.mdDoc "Name of the mute time interval, must be unique. Required."; + description = "Name of the mute time interval, must be unique. Required."; type = types.str; }; }); diff --git a/nixpkgs/nixos/modules/services/monitoring/graphite.nix b/nixpkgs/nixos/modules/services/monitoring/graphite.nix index cc3d70976204..3a8f41f32078 100644 --- a/nixpkgs/nixos/modules/services/monitoring/graphite.nix +++ b/nixpkgs/nixos/modules/services/monitoring/graphite.nix @@ -73,26 +73,26 @@ in { dataDir = mkOption { type = types.path; default = "/var/db/graphite"; - description = lib.mdDoc '' + description = '' Data directory for graphite. ''; }; web = { enable = mkOption { - description = lib.mdDoc "Whether to enable graphite web frontend."; + description = "Whether to enable graphite web frontend."; default = false; type = types.bool; }; listenAddress = mkOption { - description = lib.mdDoc "Graphite web frontend listen address."; + description = "Graphite web frontend listen address."; default = "127.0.0.1"; type = types.str; }; port = mkOption { - description = lib.mdDoc "Graphite web frontend port."; + description = "Graphite web frontend port."; default = 8080; type = types.port; }; @@ -100,7 +100,7 @@ in { extraConfig = mkOption { type = types.str; default = ""; - description = lib.mdDoc '' + description = '' Graphite webapp settings. See: <https://graphite.readthedocs.io/en/latest/config-local-settings.html> ''; @@ -109,7 +109,7 @@ in { carbon = { config = mkOption { - description = lib.mdDoc "Content of carbon configuration file."; + description = "Content of carbon configuration file."; default = '' [cache] # Listen on localhost by default for security reasons @@ -125,13 +125,13 @@ in { }; enableCache = mkOption { - description = lib.mdDoc "Whether to enable carbon cache, the graphite storage daemon."; + description = "Whether to enable carbon cache, the graphite storage daemon."; default = false; type = types.bool; }; storageAggregation = mkOption { - description = lib.mdDoc "Defines how to aggregate data to lower-precision retentions."; + description = "Defines how to aggregate data to lower-precision retentions."; default = null; type = types.nullOr types.str; example = '' @@ -143,7 +143,7 @@ in { }; storageSchemas = mkOption { - description = lib.mdDoc "Defines retention rates for storing metrics."; + description = "Defines retention rates for storing metrics."; default = ""; type = types.nullOr types.str; example = '' @@ -154,21 +154,21 @@ in { }; blacklist = mkOption { - description = lib.mdDoc "Any metrics received which match one of the expressions will be dropped."; + description = "Any metrics received which match one of the expressions will be dropped."; default = null; type = types.nullOr types.str; example = "^some\\.noisy\\.metric\\.prefix\\..*"; }; whitelist = mkOption { - description = lib.mdDoc "Only metrics received which match one of the expressions will be persisted."; + description = "Only metrics received which match one of the expressions will be persisted."; default = null; type = types.nullOr types.str; example = ".*"; }; rewriteRules = mkOption { - description = lib.mdDoc '' + description = '' Regular expression patterns that can be used to rewrite metric names in a search and replace fashion. ''; @@ -182,13 +182,13 @@ in { }; enableRelay = mkOption { - description = lib.mdDoc "Whether to enable carbon relay, the carbon replication and sharding service."; + description = "Whether to enable carbon relay, the carbon replication and sharding service."; default = false; type = types.bool; }; relayRules = mkOption { - description = lib.mdDoc "Relay rules are used to send certain metrics to a certain backend."; + description = "Relay rules are used to send certain metrics to a certain backend."; default = null; type = types.nullOr types.str; example = '' @@ -199,13 +199,13 @@ in { }; enableAggregator = mkOption { - description = lib.mdDoc "Whether to enable carbon aggregator, the carbon buffering service."; + description = "Whether to enable carbon aggregator, the carbon buffering service."; default = false; type = types.bool; }; aggregationRules = mkOption { - description = lib.mdDoc "Defines if and how received metrics will be aggregated."; + description = "Defines if and how received metrics will be aggregated."; default = null; type = types.nullOr types.str; example = '' @@ -217,13 +217,13 @@ in { seyren = { enable = mkOption { - description = lib.mdDoc "Whether to enable seyren service."; + description = "Whether to enable seyren service."; default = false; type = types.bool; }; port = mkOption { - description = lib.mdDoc "Seyren listening port."; + description = "Seyren listening port."; default = 8081; type = types.port; }; @@ -231,27 +231,27 @@ in { seyrenUrl = mkOption { default = "http://localhost:${toString cfg.seyren.port}/"; defaultText = literalExpression ''"http://localhost:''${toString config.${opt.seyren.port}}/"''; - description = lib.mdDoc "Host where seyren is accessible."; + description = "Host where seyren is accessible."; type = types.str; }; graphiteUrl = mkOption { default = "http://${cfg.web.listenAddress}:${toString cfg.web.port}"; defaultText = literalExpression ''"http://''${config.${opt.web.listenAddress}}:''${toString config.${opt.web.port}}"''; - description = lib.mdDoc "Host where graphite service runs."; + description = "Host where graphite service runs."; type = types.str; }; mongoUrl = mkOption { default = "mongodb://${config.services.mongodb.bind_ip}:27017/seyren"; defaultText = literalExpression ''"mongodb://''${config.services.mongodb.bind_ip}:27017/seyren"''; - description = lib.mdDoc "Mongodb connection string."; + description = "Mongodb connection string."; type = types.str; }; extraConfig = mkOption { default = {}; - description = lib.mdDoc '' + description = '' Extra seyren configuration. See <https://github.com/scobal/seyren#config> ''; diff --git a/nixpkgs/nixos/modules/services/monitoring/hdaps.nix b/nixpkgs/nixos/modules/services/monitoring/hdaps.nix index 59b8b9b3c054..366367ef835c 100644 --- a/nixpkgs/nixos/modules/services/monitoring/hdaps.nix +++ b/nixpkgs/nixos/modules/services/monitoring/hdaps.nix @@ -8,11 +8,10 @@ let in { options = { - services.hdapsd.enable = mkEnableOption - (lib.mdDoc '' + services.hdapsd.enable = mkEnableOption '' Hard Drive Active Protection System Daemon, devices are detected and managed automatically by udev and systemd - ''); + ''; }; config = mkIf cfg.enable { diff --git a/nixpkgs/nixos/modules/services/monitoring/heapster.nix b/nixpkgs/nixos/modules/services/monitoring/heapster.nix index 9f9c24949fc9..b8ba3632caca 100644 --- a/nixpkgs/nixos/modules/services/monitoring/heapster.nix +++ b/nixpkgs/nixos/modules/services/monitoring/heapster.nix @@ -6,22 +6,22 @@ let cfg = config.services.heapster; in { options.services.heapster = { - enable = mkEnableOption (lib.mdDoc "Heapster monitoring"); + enable = mkEnableOption "Heapster monitoring"; source = mkOption { - description = lib.mdDoc "Heapster metric source"; + description = "Heapster metric source"; example = "kubernetes:https://kubernetes.default"; type = types.str; }; sink = mkOption { - description = lib.mdDoc "Heapster metic sink"; + description = "Heapster metic sink"; example = "influxdb:http://localhost:8086"; type = types.str; }; extraOpts = mkOption { - description = lib.mdDoc "Heapster extra options"; + description = "Heapster extra options"; default = ""; type = types.separatedString " "; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/incron.nix b/nixpkgs/nixos/modules/services/monitoring/incron.nix index 3766f1fa238d..58b07bf97f1d 100644 --- a/nixpkgs/nixos/modules/services/monitoring/incron.nix +++ b/nixpkgs/nixos/modules/services/monitoring/incron.nix @@ -17,7 +17,7 @@ in enable = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Whether to enable the incron daemon. Note that commands run under incrontab only support common Nix profiles for the {env}`PATH` provided variable. @@ -27,7 +27,7 @@ in allow = mkOption { type = types.nullOr (types.listOf types.str); default = null; - description = lib.mdDoc '' + description = '' Users allowed to use incrontab. If empty then no user will be allowed to have their own incrontab. @@ -40,13 +40,13 @@ in deny = mkOption { type = types.nullOr (types.listOf types.str); default = null; - description = lib.mdDoc "Users forbidden from using incrontab."; + description = "Users forbidden from using incrontab."; }; systab = mkOption { type = types.lines; default = ""; - description = lib.mdDoc "The system incrontab contents."; + description = "The system incrontab contents."; example = '' /var/mail IN_CLOSE_WRITE abc $@/$# /tmp IN_ALL_EVENTS efg $@/$# $& @@ -57,7 +57,7 @@ in type = types.listOf types.package; default = []; example = literalExpression "[ pkgs.rsync ]"; - description = lib.mdDoc "Extra packages available to the system incrontab."; + description = "Extra packages available to the system incrontab."; }; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/kapacitor.nix b/nixpkgs/nixos/modules/services/monitoring/kapacitor.nix index c90878656899..01919e73f734 100644 --- a/nixpkgs/nixos/modules/services/monitoring/kapacitor.nix +++ b/nixpkgs/nixos/modules/services/monitoring/kapacitor.nix @@ -57,29 +57,29 @@ let in { options.services.kapacitor = { - enable = mkEnableOption (lib.mdDoc "kapacitor"); + enable = mkEnableOption "kapacitor"; dataDir = mkOption { type = types.path; default = "/var/lib/kapacitor"; - description = lib.mdDoc "Location where Kapacitor stores its state"; + description = "Location where Kapacitor stores its state"; }; port = mkOption { type = types.port; default = 9092; - description = lib.mdDoc "Port of Kapacitor"; + description = "Port of Kapacitor"; }; bind = mkOption { type = types.str; default = ""; example = "0.0.0.0"; - description = lib.mdDoc "Address to bind to. The default is to bind to all addresses"; + description = "Address to bind to. The default is to bind to all addresses"; }; extraConfig = mkOption { - description = lib.mdDoc "These lines go into kapacitord.conf verbatim."; + description = "These lines go into kapacitord.conf verbatim."; default = ""; type = types.lines; }; @@ -87,70 +87,70 @@ in user = mkOption { type = types.str; default = "kapacitor"; - description = lib.mdDoc "User account under which Kapacitor runs"; + description = "User account under which Kapacitor runs"; }; group = mkOption { type = types.str; default = "kapacitor"; - description = lib.mdDoc "Group under which Kapacitor runs"; + description = "Group under which Kapacitor runs"; }; taskSnapshotInterval = mkOption { type = types.str; - description = lib.mdDoc "Specifies how often to snapshot the task state (in InfluxDB time units)"; + description = "Specifies how often to snapshot the task state (in InfluxDB time units)"; default = "1m0s"; }; loadDirectory = mkOption { type = types.nullOr types.path; - description = lib.mdDoc "Directory where to load services from, such as tasks, templates and handlers (or null to disable service loading on startup)"; + description = "Directory where to load services from, such as tasks, templates and handlers (or null to disable service loading on startup)"; default = null; }; defaultDatabase = { - enable = mkEnableOption (lib.mdDoc "kapacitor.defaultDatabase"); + enable = mkEnableOption "kapacitor.defaultDatabase"; url = mkOption { - description = lib.mdDoc "The URL to an InfluxDB server that serves as the default database"; + description = "The URL to an InfluxDB server that serves as the default database"; example = "http://localhost:8086"; type = types.str; }; username = mkOption { - description = lib.mdDoc "The username to connect to the remote InfluxDB server"; + description = "The username to connect to the remote InfluxDB server"; type = types.str; }; password = mkOption { - description = lib.mdDoc "The password to connect to the remote InfluxDB server"; + description = "The password to connect to the remote InfluxDB server"; type = types.str; }; }; alerta = { - enable = mkEnableOption (lib.mdDoc "kapacitor alerta integration"); + enable = mkEnableOption "kapacitor alerta integration"; url = mkOption { - description = lib.mdDoc "The URL to the Alerta REST API"; + description = "The URL to the Alerta REST API"; default = "http://localhost:5000"; type = types.str; }; token = mkOption { - description = lib.mdDoc "Default Alerta authentication token"; + description = "Default Alerta authentication token"; type = types.str; default = ""; }; environment = mkOption { - description = lib.mdDoc "Default Alerta environment"; + description = "Default Alerta environment"; type = types.str; default = "Production"; }; origin = mkOption { - description = lib.mdDoc "Default origin of alert"; + description = "Default origin of alert"; type = types.str; default = "kapacitor"; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/karma.nix b/nixpkgs/nixos/modules/services/monitoring/karma.nix index 9883ec4fe841..b7ec5e4ae6fb 100644 --- a/nixpkgs/nixos/modules/services/monitoring/karma.nix +++ b/nixpkgs/nixos/modules/services/monitoring/karma.nix @@ -6,7 +6,7 @@ let in { options.services.karma = { - enable = mkEnableOption (mdDoc "the Karma dashboard service"); + enable = mkEnableOption "the Karma dashboard service"; package = mkPackageOption pkgs "karma" { }; @@ -14,7 +14,7 @@ in type = types.path; default = yaml.generate "karma.yaml" cfg.settings; defaultText = "A configuration file generated from the provided nix attributes settings option."; - description = mdDoc '' + description = '' A YAML config file which can be used to configure karma instead of the nix-generated file. ''; example = "/etc/karma/karma.conf"; @@ -23,7 +23,7 @@ in environment = mkOption { type = with types; attrsOf str; default = {}; - description = mdDoc '' + description = '' Additional environment variables to provide to karma. ''; example = { @@ -35,7 +35,7 @@ in openFirewall = mkOption { type = types.bool; default = false; - description = mdDoc '' + description = '' Whether to open ports in the firewall needed for karma to function. ''; }; @@ -43,7 +43,7 @@ in extraOptions = mkOption { type = with types; listOf str; default = []; - description = mdDoc '' + description = '' Extra command line options. ''; example = [ @@ -59,7 +59,7 @@ in address = mkOption { type = types.str; default = "127.0.0.1"; - description = mdDoc '' + description = '' Hostname or IP to listen on. ''; example = "[::]"; @@ -68,7 +68,7 @@ in port = mkOption { type = types.port; default = 8080; - description = mdDoc '' + description = '' HTTP port to listen on. ''; example = 8182; @@ -80,7 +80,7 @@ in address = "127.0.0.1"; }; }; - description = mdDoc '' + description = '' Karma dashboard configuration as nix attributes. Reference: <https://github.com/prymitive/karma/blob/main/docs/CONFIGURATION.md> diff --git a/nixpkgs/nixos/modules/services/monitoring/kthxbye.nix b/nixpkgs/nixos/modules/services/monitoring/kthxbye.nix index 3be002445722..81f47fba6679 100644 --- a/nixpkgs/nixos/modules/services/monitoring/kthxbye.nix +++ b/nixpkgs/nixos/modules/services/monitoring/kthxbye.nix @@ -7,14 +7,14 @@ in { options.services.kthxbye = { - enable = mkEnableOption (mdDoc "kthxbye alert acknowledgement management daemon"); + enable = mkEnableOption "kthxbye alert acknowledgement management daemon"; package = mkPackageOption pkgs "kthxbye" { }; openFirewall = mkOption { type = types.bool; default = false; - description = mdDoc '' + description = '' Whether to open ports in the firewall needed for the daemon to function. ''; }; @@ -22,7 +22,7 @@ in extraOptions = mkOption { type = with types; listOf str; default = []; - description = mdDoc '' + description = '' Extra command line options. Documentation can be found [here](https://github.com/prymitive/kthxbye/blob/main/README.md). @@ -38,7 +38,7 @@ in timeout = mkOption { type = types.str; default = "1m0s"; - description = mdDoc '' + description = '' Alertmanager request timeout duration in the [time.Duration](https://pkg.go.dev/time#ParseDuration) format. ''; example = "30s"; @@ -46,7 +46,7 @@ in uri = mkOption { type = types.str; default = "http://localhost:9093"; - description = mdDoc '' + description = '' Alertmanager URI to use. ''; example = "https://alertmanager.example.com"; @@ -56,7 +56,7 @@ in extendBy = mkOption { type = types.str; default = "15m0s"; - description = mdDoc '' + description = '' Extend silences by adding DURATION seconds. DURATION should be provided in the [time.Duration](https://pkg.go.dev/time#ParseDuration) format. @@ -67,7 +67,7 @@ in extendIfExpiringIn = mkOption { type = types.str; default = "5m0s"; - description = mdDoc '' + description = '' Extend silences that are about to expire in the next DURATION seconds. DURATION should be provided in the [time.Duration](https://pkg.go.dev/time#ParseDuration) format. @@ -78,7 +78,7 @@ in extendWithPrefix = mkOption { type = types.str; default = "ACK!"; - description = mdDoc '' + description = '' Extend silences with comment starting with PREFIX string. ''; example = "!perma-silence"; @@ -87,7 +87,7 @@ in interval = mkOption { type = types.str; default = "45s"; - description = mdDoc '' + description = '' Silence check interval duration in the [time.Duration](https://pkg.go.dev/time#ParseDuration) format. ''; example = "30s"; @@ -96,7 +96,7 @@ in listenAddress = mkOption { type = types.str; default = "0.0.0.0"; - description = mdDoc '' + description = '' The address to listen on for HTTP requests. ''; example = "127.0.0.1"; @@ -105,7 +105,7 @@ in port = mkOption { type = types.port; default = 8080; - description = mdDoc '' + description = '' The port to listen on for HTTP requests. ''; }; @@ -113,7 +113,7 @@ in logJSON = mkOption { type = types.bool; default = false; - description = mdDoc '' + description = '' Format logged messages as JSON. ''; }; @@ -121,7 +121,7 @@ in maxDuration = mkOption { type = with types; nullOr str; default = null; - description = mdDoc '' + description = '' Maximum duration of a silence, it won't be extended anymore after reaching it. Duration should be provided in the [time.Duration](https://pkg.go.dev/time#ParseDuration) format. diff --git a/nixpkgs/nixos/modules/services/monitoring/loki.nix b/nixpkgs/nixos/modules/services/monitoring/loki.nix index fade3c4fbad3..ba63f95e7f1a 100644 --- a/nixpkgs/nixos/modules/services/monitoring/loki.nix +++ b/nixpkgs/nixos/modules/services/monitoring/loki.nix @@ -12,12 +12,12 @@ let in { options.services.loki = { - enable = mkEnableOption (lib.mdDoc "loki"); + enable = mkEnableOption "loki"; user = mkOption { type = types.str; default = "loki"; - description = lib.mdDoc '' + description = '' User under which the Loki service runs. ''; }; @@ -27,7 +27,7 @@ in { group = mkOption { type = types.str; default = "loki"; - description = lib.mdDoc '' + description = '' Group under which the Loki service runs. ''; }; @@ -35,7 +35,7 @@ in { dataDir = mkOption { type = types.path; default = "/var/lib/loki"; - description = lib.mdDoc '' + description = '' Specify the directory for Loki. ''; }; @@ -43,7 +43,7 @@ in { configuration = mkOption { type = (pkgs.formats.json {}).type; default = {}; - description = lib.mdDoc '' + description = '' Specify the configuration for Loki in Nix. ''; }; @@ -51,7 +51,7 @@ in { configFile = mkOption { type = types.nullOr types.path; default = null; - description = lib.mdDoc '' + description = '' Specify a configuration file that Loki should use. ''; }; @@ -60,7 +60,7 @@ in { type = types.listOf types.str; default = []; example = [ "--server.http-listen-port=3101" ]; - description = lib.mdDoc '' + description = '' Specify a list of additional command line flags, which get escaped and are then passed to Loki. ''; diff --git a/nixpkgs/nixos/modules/services/monitoring/longview.nix b/nixpkgs/nixos/modules/services/monitoring/longview.nix index 5825cab0134c..aafe54b994ab 100644 --- a/nixpkgs/nixos/modules/services/monitoring/longview.nix +++ b/nixpkgs/nixos/modules/services/monitoring/longview.nix @@ -16,7 +16,7 @@ in { enable = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' If enabled, system metrics will be sent to Linode LongView. ''; }; @@ -25,7 +25,7 @@ in { type = types.str; default = ""; example = "01234567-89AB-CDEF-0123456789ABCDEF"; - description = lib.mdDoc '' + description = '' Longview API key. To get this, look in Longview settings which are found at https://manager.linode.com/longview/. @@ -38,7 +38,7 @@ in { type = types.nullOr types.path; default = null; example = "/run/keys/longview-api-key"; - description = lib.mdDoc '' + description = '' A file containing the Longview API key. To get this, look in Longview settings which are found at https://manager.linode.com/longview/. @@ -51,7 +51,7 @@ in { type = types.str; default = ""; example = "http://127.0.0.1/server-status"; - description = lib.mdDoc '' + description = '' The Apache status page URL. If provided, Longview will gather statistics from this location. This requires Apache mod_status to be loaded and enabled. @@ -62,7 +62,7 @@ in { type = types.str; default = ""; example = "http://127.0.0.1/nginx_status"; - description = lib.mdDoc '' + description = '' The Nginx status page URL. Longview will gather statistics from this URL. This requires the Nginx stub_status module to be enabled and configured at the given location. @@ -72,7 +72,7 @@ in { mysqlUser = mkOption { type = types.str; default = ""; - description = lib.mdDoc '' + description = '' The user for connecting to the MySQL database. If provided, Longview will connect to MySQL and collect statistics about queries, etc. This user does not need to have been granted @@ -83,7 +83,7 @@ in { mysqlPassword = mkOption { type = types.str; default = ""; - description = lib.mdDoc '' + description = '' The password corresponding to {option}`mysqlUser`. Warning: this is stored in cleartext in the Nix store! Use {option}`mysqlPasswordFile` instead. @@ -94,7 +94,7 @@ in { type = types.nullOr types.path; default = null; example = "/run/keys/dbpassword"; - description = lib.mdDoc '' + description = '' A file containing the password corresponding to {option}`mysqlUser`. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/mackerel-agent.nix b/nixpkgs/nixos/modules/services/monitoring/mackerel-agent.nix index d1e84c0359dc..d218c18c4354 100644 --- a/nixpkgs/nixos/modules/services/monitoring/mackerel-agent.nix +++ b/nixpkgs/nixos/modules/services/monitoring/mackerel-agent.nix @@ -7,20 +7,20 @@ let settingsFmt = pkgs.formats.toml {}; in { options.services.mackerel-agent = { - enable = mkEnableOption (lib.mdDoc "mackerel.io agent"); + enable = mkEnableOption "mackerel.io agent"; # the upstream package runs as root, but doesn't seem to be strictly # necessary for basic functionality - runAsRoot = mkEnableOption (lib.mdDoc "running as root"); + runAsRoot = mkEnableOption "running as root"; - autoRetirement = mkEnableOption (lib.mdDoc '' + autoRetirement = mkEnableOption '' retiring the host upon OS shutdown - ''); + ''; apiKeyFile = mkOption { type = types.path; example = "/run/keys/mackerel-api-key"; - description = lib.mdDoc '' + description = '' Path to file containing the Mackerel API key. The file should contain a single line of the following form: @@ -29,7 +29,7 @@ in { }; settings = mkOption { - description = lib.mdDoc '' + description = '' Options for mackerel-agent.conf. Documentation: @@ -48,18 +48,18 @@ in { options.host_status = { on_start = mkOption { type = types.enum [ "working" "standby" "maintenance" "poweroff" ]; - description = lib.mdDoc "Host status after agent startup."; + description = "Host status after agent startup."; default = "working"; }; on_stop = mkOption { type = types.enum [ "working" "standby" "maintenance" "poweroff" ]; - description = lib.mdDoc "Host status after agent shutdown."; + description = "Host status after agent shutdown."; default = "poweroff"; }; }; options.diagnostic = - mkEnableOption (lib.mdDoc "collecting memory usage for the agent itself"); + mkEnableOption "collecting memory usage for the agent itself"; }; }; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/metricbeat.nix b/nixpkgs/nixos/modules/services/monitoring/metricbeat.nix index c3320f695564..fe6f7f1cfcfa 100644 --- a/nixpkgs/nixos/modules/services/monitoring/metricbeat.nix +++ b/nixpkgs/nixos/modules/services/monitoring/metricbeat.nix @@ -20,14 +20,14 @@ in services.metricbeat = { - enable = mkEnableOption (lib.mdDoc "metricbeat"); + enable = mkEnableOption "metricbeat"; package = mkPackageOption pkgs "metricbeat" { example = "metricbeat7"; }; modules = mkOption { - description = lib.mdDoc '' + description = '' Metricbeat modules are responsible for reading metrics from the various sources. This is like `services.metricbeat.settings.metricbeat.modules`, @@ -46,7 +46,7 @@ in module = mkOption { type = types.str; default = name; - description = lib.mdDoc '' + description = '' The name of the module. Look for the value after `module:` on the individual @@ -75,7 +75,7 @@ in name = mkOption { type = types.str; default = ""; - description = lib.mdDoc '' + description = '' Name of the beat. Defaults to the hostname. See <https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-general-options.html#_name>. ''; @@ -84,7 +84,7 @@ in tags = mkOption { type = types.listOf types.str; default = []; - description = lib.mdDoc '' + description = '' Tags to place on the shipped metrics. See <https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-general-options.html#_tags_2>. ''; @@ -94,7 +94,7 @@ in type = types.listOf settingsFormat.type; default = []; internal = true; - description = lib.mdDoc '' + description = '' The metric collecting modules. Use [](#opt-services.metricbeat.modules) instead. See <https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-modules.html>. @@ -103,7 +103,7 @@ in }; }; default = {}; - description = lib.mdDoc '' + description = '' Configuration for metricbeat. See <https://www.elastic.co/guide/en/beats/metricbeat/current/configuring-howto-metricbeat.html> for supported values. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/mimir.nix b/nixpkgs/nixos/modules/services/monitoring/mimir.nix index 117cbf6a4a8c..76fff95ae597 100644 --- a/nixpkgs/nixos/modules/services/monitoring/mimir.nix +++ b/nixpkgs/nixos/modules/services/monitoring/mimir.nix @@ -8,12 +8,12 @@ let settingsFormat = pkgs.formats.yaml {}; in { options.services.mimir = { - enable = mkEnableOption (lib.mdDoc "mimir"); + enable = mkEnableOption "mimir"; configuration = mkOption { type = (pkgs.formats.json {}).type; default = {}; - description = lib.mdDoc '' + description = '' Specify the configuration for Mimir in Nix. ''; }; @@ -21,7 +21,7 @@ in { configFile = mkOption { type = types.nullOr types.path; default = null; - description = lib.mdDoc '' + description = '' Specify a configuration file that Mimir should use. ''; }; @@ -32,7 +32,7 @@ in { type = types.listOf types.str; default = []; example = [ "--config.expand-env=true" ]; - description = lib.mdDoc '' + description = '' Specify a list of additional command line flags, which get escaped and are then passed to Mimir. ''; diff --git a/nixpkgs/nixos/modules/services/monitoring/monit.nix b/nixpkgs/nixos/modules/services/monitoring/monit.nix index a22bbc9046ba..379ee967620e 100644 --- a/nixpkgs/nixos/modules/services/monitoring/monit.nix +++ b/nixpkgs/nixos/modules/services/monitoring/monit.nix @@ -9,12 +9,12 @@ in { options.services.monit = { - enable = mkEnableOption (lib.mdDoc "Monit"); + enable = mkEnableOption "Monit"; config = mkOption { type = types.lines; default = ""; - description = lib.mdDoc "monitrc content"; + description = "monitrc content"; }; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/munin.nix b/nixpkgs/nixos/modules/services/monitoring/munin.nix index 456a14169b95..401f6383cb57 100644 --- a/nixpkgs/nixos/modules/services/monitoring/munin.nix +++ b/nixpkgs/nixos/modules/services/monitoring/munin.nix @@ -143,7 +143,7 @@ in enable = mkOption { default = false; type = types.bool; - description = lib.mdDoc '' + description = '' Enable Munin Node agent. Munin node listens on 0.0.0.0 and by default accepts connections only from 127.0.0.1 for security reasons. @@ -154,7 +154,7 @@ in extraConfig = mkOption { default = ""; type = types.lines; - description = lib.mdDoc '' + description = '' {file}`munin-node.conf` extra configuration. See <https://guide.munin-monitoring.org/en/latest/reference/munin-node.conf.html> ''; @@ -163,7 +163,7 @@ in extraPluginConfig = mkOption { default = ""; type = types.lines; - description = lib.mdDoc '' + description = '' {file}`plugin-conf.d` extra plugin configuration. See <https://guide.munin-monitoring.org/en/latest/plugin/use.html> ''; @@ -176,7 +176,7 @@ in extraPlugins = mkOption { default = {}; type = with types; attrsOf path; - description = lib.mdDoc '' + description = '' Additional Munin plugins to activate. Keys are the name of the plugin symlink, values are the path to the underlying plugin script. You can use the same plugin script multiple times (e.g. for wildcard @@ -206,7 +206,7 @@ in extraAutoPlugins = mkOption { default = []; type = with types; listOf path; - description = lib.mdDoc '' + description = '' Additional Munin plugins to autoconfigure, using `munin-node-configure --suggest`. These should be the actual paths to the plugin files (or directories containing them), @@ -239,7 +239,7 @@ in # NaNs in the output. default = [ "munin_stats" ]; type = with types; listOf str; - description = lib.mdDoc '' + description = '' Munin plugins to disable, even if `munin-node-configure --suggest` tries to enable them. To disable a wildcard plugin, use an actual wildcard, as in @@ -258,7 +258,7 @@ in enable = mkOption { default = false; type = types.bool; - description = lib.mdDoc '' + description = '' Enable munin-cron. Takes care of all heavy lifting to collect data from nodes and draws graphs to html. Runs munin-update, munin-limits, munin-graphs and munin-html in that order. @@ -271,7 +271,7 @@ in extraGlobalConfig = mkOption { default = ""; type = types.lines; - description = lib.mdDoc '' + description = '' {file}`munin.conf` extra global configuration. See <https://guide.munin-monitoring.org/en/latest/reference/munin.conf.html>. Useful to setup notifications, see @@ -285,7 +285,7 @@ in hosts = mkOption { default = ""; type = types.lines; - description = lib.mdDoc '' + description = '' Definitions of hosts of nodes to collect data from. Needs at least one host for cron to succeed. See <https://guide.munin-monitoring.org/en/latest/reference/munin.conf.html> @@ -301,7 +301,7 @@ in extraCSS = mkOption { default = ""; type = types.lines; - description = lib.mdDoc '' + description = '' Custom styling for the HTML that munin-cron generates. This will be appended to the CSS files used by munin-cron and will thus take precedence over the builtin styles. diff --git a/nixpkgs/nixos/modules/services/monitoring/nagios.nix b/nixpkgs/nixos/modules/services/monitoring/nagios.nix index dc5fa1be2922..27fc0a1ff3b9 100644 --- a/nixpkgs/nixos/modules/services/monitoring/nagios.nix +++ b/nixpkgs/nixos/modules/services/monitoring/nagios.nix @@ -88,10 +88,10 @@ in options = { services.nagios = { - enable = mkEnableOption (lib.mdDoc ''[Nagios](https://www.nagios.org/) to monitor your system or network.''); + enable = mkEnableOption ''[Nagios](https://www.nagios.org/) to monitor your system or network.''; objectDefs = mkOption { - description = lib.mdDoc '' + description = '' A list of Nagios object configuration files that must define the hosts, host groups, services and contacts for the network that you want Nagios to monitor. @@ -104,7 +104,7 @@ in type = types.listOf types.package; default = with pkgs; [ monitoring-plugins msmtp mailutils ]; defaultText = literalExpression "[pkgs.monitoring-plugins pkgs.msmtp pkgs.mailutils]"; - description = lib.mdDoc '' + description = '' Packages to be added to the Nagios {env}`PATH`. Typically used to add plugins, but can be anything. ''; @@ -113,7 +113,7 @@ in mainConfigFile = mkOption { type = types.nullOr types.package; default = null; - description = lib.mdDoc '' + description = '' If non-null, overrides the main configuration file of Nagios. ''; }; @@ -125,21 +125,21 @@ in debug_file = "/var/log/nagios/debug.log"; }; default = {}; - description = lib.mdDoc "Configuration to add to /etc/nagios.cfg"; + description = "Configuration to add to /etc/nagios.cfg"; }; validateConfig = mkOption { type = types.bool; default = pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform; defaultText = literalExpression "pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform"; - description = lib.mdDoc "if true, the syntax of the nagios configuration file is checked at build time"; + description = "if true, the syntax of the nagios configuration file is checked at build time"; }; cgiConfigFile = mkOption { type = types.package; default = nagiosCGICfgFile; defaultText = literalExpression "nagiosCGICfgFile"; - description = lib.mdDoc '' + description = '' Derivation for the configuration file of Nagios CGI scripts that can be used in web servers for running the Nagios web interface. ''; @@ -148,7 +148,7 @@ in enableWebInterface = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Whether to enable the Nagios web interface. You should also enable Apache ({option}`services.httpd.enable`). ''; @@ -164,7 +164,7 @@ in sslServerKey = "/var/lib/acme/example.org/key.pem"; } ''; - description = lib.mdDoc '' + description = '' Apache configuration can be done by adapting {option}`services.httpd.virtualHosts`. See [](#opt-services.httpd.virtualHosts) for further information. ''; diff --git a/nixpkgs/nixos/modules/services/monitoring/netdata.nix b/nixpkgs/nixos/modules/services/monitoring/netdata.nix index 5cf3c096397c..90e00e91deed 100644 --- a/nixpkgs/nixos/modules/services/monitoring/netdata.nix +++ b/nixpkgs/nixos/modules/services/monitoring/netdata.nix @@ -50,25 +50,25 @@ let in { options = { services.netdata = { - enable = mkEnableOption (lib.mdDoc "netdata"); + enable = mkEnableOption "netdata"; package = mkPackageOption pkgs "netdata" { }; user = mkOption { type = types.str; default = "netdata"; - description = lib.mdDoc "User account under which netdata runs."; + description = "User account under which netdata runs."; }; group = mkOption { type = types.str; default = "netdata"; - description = lib.mdDoc "Group under which netdata runs."; + description = "Group under which netdata runs."; }; configText = mkOption { type = types.nullOr types.lines; - description = lib.mdDoc "Verbatim netdata.conf, cannot be combined with config."; + description = "Verbatim netdata.conf, cannot be combined with config."; default = null; example = '' [global] @@ -82,7 +82,7 @@ in { enable = mkOption { type = types.bool; default = true; - description = lib.mdDoc '' + description = '' Whether to enable python-based plugins ''; }; @@ -97,7 +97,7 @@ in { ps.dnspython ] ''; - description = lib.mdDoc '' + description = '' Extra python packages available at runtime to enable additional python plugins. ''; @@ -110,7 +110,7 @@ in { example = literalExpression '' [ "/path/to/plugins.d" ] ''; - description = lib.mdDoc '' + description = '' Extra paths to add to the netdata global "plugins directory" option. Useful for when you want to include your own collection scripts. @@ -125,7 +125,7 @@ in { config = mkOption { type = types.attrsOf types.attrs; default = {}; - description = lib.mdDoc "netdata.conf configuration as nix attributes. cannot be combined with configText."; + description = "netdata.conf configuration as nix attributes. cannot be combined with configText."; example = literalExpression '' global = { "debug log" = "syslog"; @@ -138,7 +138,7 @@ in { configDir = mkOption { type = types.attrsOf types.path; default = {}; - description = lib.mdDoc '' + description = '' Complete netdata config directory except netdata.conf. The default configuration is merged with changes defined in this option. @@ -158,7 +158,7 @@ in { claimTokenFile = mkOption { type = types.nullOr types.path; default = null; - description = lib.mdDoc '' + description = '' If set, automatically registers the agent using the given claim token file. ''; @@ -167,7 +167,7 @@ in { enableAnalyticsReporting = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Enable reporting of anonymous usage statistics to Netdata Inc. via either Google Analytics (in versions prior to 1.29.4), or Netdata Inc.'s self-hosted PostHog (in versions 1.29.4 and later). @@ -178,7 +178,7 @@ in { deadlineBeforeStopSec = mkOption { type = types.int; default = 120; - description = lib.mdDoc '' + description = '' In order to detect when netdata is misbehaving, we run a concurrent task pinging netdata (wait-for-netdata-up) in the systemd unit. diff --git a/nixpkgs/nixos/modules/services/monitoring/nezha-agent.nix b/nixpkgs/nixos/modules/services/monitoring/nezha-agent.nix new file mode 100644 index 000000000000..8312a425d28f --- /dev/null +++ b/nixpkgs/nixos/modules/services/monitoring/nezha-agent.nix @@ -0,0 +1,103 @@ +{ + config, + lib, + pkgs, + ... +}: +let + cfg = config.services.nezha-agent; +in +{ + meta = { + maintainers = with lib.maintainers; [ moraxyc ]; + }; + options = { + services.nezha-agent = { + enable = lib.mkEnableOption "Agent of Nezha Monitoring"; + + package = lib.mkPackageOption pkgs "nezha-agent" { }; + debug = lib.mkEnableOption "verbose log"; + tls = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Enable SSL/TLS encryption. + ''; + }; + disableCommandExecute = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Disable executing the command from dashboard. + ''; + }; + skipConnection = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Do not monitor the number of connections. + ''; + }; + skipProcess = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Do not monitor the number of processes. + ''; + }; + reportDelay = lib.mkOption { + type = lib.types.enum [ 1 2 3 4 ]; + default = 1; + description = '' + The interval between system status reportings. + The value must be an integer from 1 to 4 + ''; + }; + passwordFile = lib.mkOption { + type = with lib.types; nullOr str; + default = null; + description = '' + Path to the file contained the password from dashboard. + ''; + }; + server = lib.mkOption { + type = lib.types.str; + description = '' + Address to the dashboard + ''; + }; + }; + }; + + config = lib.mkIf cfg.enable { + systemd.packages = [ cfg.package ]; + + systemd.services.nezha-agent = { + serviceConfig = { + ProtectSystem = "full"; + PrivateDevices = "yes"; + PrivateTmp = "yes"; + NoNewPrivileges = true; + }; + path = [ cfg.package ]; + startLimitIntervalSec = 10; + startLimitBurst = 3; + script = lib.concatStringsSep " " ( + [ + "${cfg.package}/bin/agent" + "--disable-auto-update" + "--disable-force-update" + "--password $(cat ${cfg.passwordFile})" + ] + ++ lib.optional cfg.debug "--debug" + ++ lib.optional cfg.disableCommandExecute "--disable-command-execute" + ++ lib.optional (cfg.reportDelay != null) "--report-delay ${toString cfg.reportDelay}" + ++ lib.optional (cfg.server != null) "--server ${cfg.server}" + ++ lib.optional cfg.skipConnection "--skip-conn" + ++ lib.optional cfg.skipProcess "--skip-procs" + ++ lib.optional cfg.tls "--tls" + ); + wantedBy = [ "multi-user.target" ]; + }; + }; +} diff --git a/nixpkgs/nixos/modules/services/monitoring/ocsinventory-agent.nix b/nixpkgs/nixos/modules/services/monitoring/ocsinventory-agent.nix index a36375587759..591738ed4ef7 100644 --- a/nixpkgs/nixos/modules/services/monitoring/ocsinventory-agent.nix +++ b/nixpkgs/nixos/modules/services/monitoring/ocsinventory-agent.nix @@ -16,7 +16,7 @@ in options = { services.ocsinventory-agent = { - enable = lib.mkEnableOption (lib.mdDoc "OCS Inventory Agent"); + enable = lib.mkEnableOption "OCS Inventory Agent"; package = lib.mkPackageOption pkgs "ocsinventory-agent" { }; @@ -29,7 +29,7 @@ in type = lib.types.nullOr lib.types.str; example = "https://ocsinventory.localhost:8080/ocsinventory"; default = null; - description = lib.mdDoc '' + description = '' The URI of the OCS Inventory server where to send the inventory file. This option is ignored if {option}`services.ocsinventory-agent.settings.local` is set. @@ -40,7 +40,7 @@ in type = lib.types.nullOr lib.types.path; example = "/var/lib/ocsinventory-agent/reports"; default = null; - description = lib.mdDoc '' + description = '' If specified, the OCS Inventory Agent will run in offline mode and the resulting inventory file will be stored in the specified path. ''; @@ -49,7 +49,7 @@ in ca = lib.mkOption { type = lib.types.path; default = "/etc/ssl/certs/ca-certificates.crt"; - description = lib.mdDoc '' + description = '' Path to CA certificates file in PEM format, for server SSL certificate validation. ''; @@ -59,10 +59,10 @@ in type = lib.types.nullOr lib.types.str; default = null; example = "01234567890123"; - description = lib.mdDoc "Tag for the generated inventory."; + description = "Tag for the generated inventory."; }; - debug = lib.mkEnableOption (lib.mdDoc "debug mode"); + debug = lib.mkEnableOption "debug mode"; }; }; default = { }; @@ -72,7 +72,7 @@ in server = "https://ocsinventory.localhost:8080/ocsinventory"; tag = "01234567890123"; }; - description = lib.mdDoc '' + description = '' Configuration for /etc/ocsinventory-agent/ocsinventory-agent.cfg. Refer to @@ -84,7 +84,7 @@ in type = lib.types.str; default = "daily"; example = "06:00"; - description = lib.mdDoc '' + description = '' How often we run the ocsinventory-agent service. Runs by default every daily. The format is described in diff --git a/nixpkgs/nixos/modules/services/monitoring/opentelemetry-collector.nix b/nixpkgs/nixos/modules/services/monitoring/opentelemetry-collector.nix index 83ad550dcdf3..459cc8532490 100644 --- a/nixpkgs/nixos/modules/services/monitoring/opentelemetry-collector.nix +++ b/nixpkgs/nixos/modules/services/monitoring/opentelemetry-collector.nix @@ -9,14 +9,14 @@ let settingsFormat = pkgs.formats.yaml {}; in { options.services.opentelemetry-collector = { - enable = mkEnableOption (lib.mdDoc "Opentelemetry Collector"); + enable = mkEnableOption "Opentelemetry Collector"; package = mkPackageOption pkgs "opentelemetry-collector" { }; settings = mkOption { type = settingsFormat.type; default = {}; - description = lib.mdDoc '' + description = '' Specify the configuration for Opentelemetry Collector in Nix. See https://opentelemetry.io/docs/collector/configuration/ for available options. @@ -26,7 +26,7 @@ in { configFile = mkOption { type = types.nullOr types.path; default = null; - description = lib.mdDoc '' + description = '' Specify a path to a configuration file that Opentelemetry Collector should use. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/osquery.nix b/nixpkgs/nixos/modules/services/monitoring/osquery.nix index 86ef3fc73213..872f5e96a412 100644 --- a/nixpkgs/nixos/modules/services/monitoring/osquery.nix +++ b/nixpkgs/nixos/modules/services/monitoring/osquery.nix @@ -26,11 +26,11 @@ let in { options.services.osquery = { - enable = mkEnableOption (mdDoc "osqueryd daemon"); + enable = mkEnableOption "osqueryd daemon"; settings = mkOption { default = { }; - description = mdDoc '' + description = '' Configuration to be written to the osqueryd JSON configuration file. To understand the configuration format, refer to https://osquery.readthedocs.io/en/stable/deployment/configuration/#configuration-components. ''; @@ -42,7 +42,7 @@ in flags = mkOption { default = { }; - description = mdDoc '' + description = '' Attribute set of flag names and values to be written to the osqueryd flagfile. For more information, refer to https://osquery.readthedocs.io/en/stable/installation/cli-flags. ''; @@ -56,19 +56,19 @@ in database_path = mkOption { default = "/var/lib/osquery/osquery.db"; readOnly = true; - description = mdDoc "Path used for the database file."; + description = "Path used for the database file."; type = path; }; logger_path = mkOption { default = "/var/log/osquery"; readOnly = true; - description = mdDoc "Base directory used for logging."; + description = "Base directory used for logging."; type = path; }; pidfile = mkOption { default = "/run/osquery/osqueryd.pid"; readOnly = true; - description = mdDoc "Path used for pid file."; + description = "Path used for pid file."; type = path; }; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/parsedmarc.nix b/nixpkgs/nixos/modules/services/monitoring/parsedmarc.nix index a146e7ab9543..a14ade59c29e 100644 --- a/nixpkgs/nixos/modules/services/monitoring/parsedmarc.nix +++ b/nixpkgs/nixos/modules/services/monitoring/parsedmarc.nix @@ -20,16 +20,16 @@ in { options.services.parsedmarc = { - enable = lib.mkEnableOption (lib.mdDoc '' + enable = lib.mkEnableOption '' parsedmarc, a DMARC report monitoring service - ''); + ''; provision = { localMail = { enable = lib.mkOption { type = lib.types.bool; default = false; - description = lib.mdDoc '' + description = '' Whether Postfix and Dovecot should be set up to receive mail locally. parsedmarc will be configured to watch the local inbox as the automatically created user specified in @@ -40,7 +40,7 @@ in recipientName = lib.mkOption { type = lib.types.str; default = "dmarc"; - description = lib.mdDoc '' + description = '' The DMARC mail recipient name, i.e. the name part of the email address which receives DMARC reports. @@ -54,7 +54,7 @@ in default = config.networking.fqdn; defaultText = lib.literalExpression "config.networking.fqdn"; example = "monitoring.example.com"; - description = lib.mdDoc '' + description = '' The hostname to use when configuring Postfix. Should correspond to the host's fully qualified domain @@ -68,7 +68,7 @@ in geoIp = lib.mkOption { type = lib.types.bool; default = true; - description = lib.mdDoc '' + description = '' Whether to enable and configure the [geoipupdate](#opt-services.geoipupdate.enable) service to automatically fetch GeoIP databases. Not crucial, but recommended for full functionality. @@ -82,7 +82,7 @@ in elasticsearch = lib.mkOption { type = lib.types.bool; default = true; - description = lib.mdDoc '' + description = '' Whether to set up and use a local instance of Elasticsearch. ''; }; @@ -95,7 +95,7 @@ in config.${opt.provision.elasticsearch} && config.${options.services.grafana.enable} ''; apply = x: x && cfg.provision.elasticsearch; - description = lib.mdDoc '' + description = '' Whether the automatically provisioned Elasticsearch instance should be added as a grafana datasource. Has no effect unless @@ -108,7 +108,7 @@ in type = lib.types.bool; default = config.services.grafana.enable; defaultText = lib.literalExpression "config.services.grafana.enable"; - description = lib.mdDoc '' + description = '' Whether the official parsedmarc grafana dashboard should be provisioned to the local grafana instance. ''; @@ -135,7 +135,7 @@ in }; } ''; - description = lib.mdDoc '' + description = '' Configuration parameters to set in {file}`parsedmarc.ini`. For a full list of available parameters, see @@ -159,7 +159,7 @@ in save_aggregate = lib.mkOption { type = lib.types.bool; default = true; - description = lib.mdDoc '' + description = '' Save aggregate report data to Elasticsearch and/or Splunk. ''; }; @@ -167,7 +167,7 @@ in save_forensic = lib.mkOption { type = lib.types.bool; default = true; - description = lib.mdDoc '' + description = '' Save forensic report data to Elasticsearch and/or Splunk. ''; }; @@ -177,7 +177,7 @@ in watch = lib.mkOption { type = lib.types.bool; default = true; - description = lib.mdDoc '' + description = '' Use the IMAP IDLE command to process messages as they arrive. ''; }; @@ -185,7 +185,7 @@ in delete = lib.mkOption { type = lib.types.bool; default = false; - description = lib.mdDoc '' + description = '' Delete messages after processing them, instead of archiving them. ''; }; @@ -195,7 +195,7 @@ in host = lib.mkOption { type = lib.types.str; default = "localhost"; - description = lib.mdDoc '' + description = '' The IMAP server hostname or IP address. ''; }; @@ -203,7 +203,7 @@ in port = lib.mkOption { type = lib.types.port; default = 993; - description = lib.mdDoc '' + description = '' The IMAP server port. ''; }; @@ -211,7 +211,7 @@ in ssl = lib.mkOption { type = lib.types.bool; default = true; - description = lib.mdDoc '' + description = '' Use an encrypted SSL/TLS connection. ''; }; @@ -219,7 +219,7 @@ in user = lib.mkOption { type = with lib.types; nullOr str; default = null; - description = lib.mdDoc '' + description = '' The IMAP server username. ''; }; @@ -227,7 +227,7 @@ in password = lib.mkOption { type = with lib.types; nullOr (either path (attrsOf path)); default = null; - description = lib.mdDoc '' + description = '' The IMAP server password. Always handled as a secret whether the value is @@ -243,7 +243,7 @@ in host = lib.mkOption { type = with lib.types; nullOr str; default = null; - description = lib.mdDoc '' + description = '' The SMTP server hostname or IP address. ''; }; @@ -251,7 +251,7 @@ in port = lib.mkOption { type = with lib.types; nullOr port; default = null; - description = lib.mdDoc '' + description = '' The SMTP server port. ''; }; @@ -259,7 +259,7 @@ in ssl = lib.mkOption { type = with lib.types; nullOr bool; default = null; - description = lib.mdDoc '' + description = '' Use an encrypted SSL/TLS connection. ''; }; @@ -267,7 +267,7 @@ in user = lib.mkOption { type = with lib.types; nullOr str; default = null; - description = lib.mdDoc '' + description = '' The SMTP server username. ''; }; @@ -275,7 +275,7 @@ in password = lib.mkOption { type = with lib.types; nullOr (either path (attrsOf path)); default = null; - description = lib.mdDoc '' + description = '' The SMTP server password. Always handled as a secret whether the value is @@ -289,7 +289,7 @@ in from = lib.mkOption { type = with lib.types; nullOr str; default = null; - description = lib.mdDoc '' + description = '' The `From` address to use for the outgoing mail. ''; @@ -298,10 +298,10 @@ in to = lib.mkOption { type = with lib.types; nullOr (listOf str); default = null; - description = lib.mdDoc '' + description = '' The addresses to send outgoing mail to. ''; - apply = x: if x == [] then null else lib.concatStringsSep "," x; + apply = x: if x == [] || x == null then null else lib.concatStringsSep "," x; }; }; @@ -310,7 +310,7 @@ in default = []; type = with lib.types; listOf str; apply = x: if x == [] then null else lib.concatStringsSep "," x; - description = lib.mdDoc '' + description = '' A list of Elasticsearch hosts to push parsed reports to. ''; @@ -319,7 +319,7 @@ in user = lib.mkOption { type = with lib.types; nullOr str; default = null; - description = lib.mdDoc '' + description = '' Username to use when connecting to Elasticsearch, if required. ''; @@ -328,7 +328,7 @@ in password = lib.mkOption { type = with lib.types; nullOr (either path (attrsOf path)); default = null; - description = lib.mdDoc '' + description = '' The password to use when connecting to Elasticsearch, if required. @@ -343,7 +343,7 @@ in ssl = lib.mkOption { type = lib.types.bool; default = false; - description = lib.mdDoc '' + description = '' Whether to use an encrypted SSL/TLS connection. ''; }; @@ -351,7 +351,7 @@ in cert_path = lib.mkOption { type = lib.types.path; default = "/etc/ssl/certs/ca-certificates.crt"; - description = lib.mdDoc '' + description = '' The path to a TLS certificate bundle used to verify the server's certificate. ''; @@ -438,7 +438,7 @@ in ]; dashboards.settings.providers = lib.mkIf cfg.provision.grafana.dashboard [{ name = "parsedmarc"; - options.path = "${pkgs.python3Packages.parsedmarc.dashboard}"; + options.path = "${pkgs.parsedmarc.dashboard}"; }]; }; }; @@ -446,7 +446,7 @@ in services.parsedmarc.settings = lib.mkMerge [ (lib.mkIf cfg.provision.elasticsearch { elasticsearch = { - hosts = [ "localhost:9200" ]; + hosts = [ "http://localhost:9200" ]; ssl = false; }; }) @@ -530,7 +530,7 @@ in MemoryDenyWriteExecute = true; LockPersonality = true; SystemCallArchitectures = "native"; - ExecStart = "${pkgs.python3Packages.parsedmarc}/bin/parsedmarc -c /run/parsedmarc/parsedmarc.ini"; + ExecStart = "${lib.getExe pkgs.parsedmarc} -c /run/parsedmarc/parsedmarc.ini"; }; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/alertmanager-irc-relay.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/alertmanager-irc-relay.nix index 9b9bafa09441..eda4277c1bac 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/alertmanager-irc-relay.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/alertmanager-irc-relay.nix @@ -10,14 +10,14 @@ let in { options.services.prometheus.alertmanagerIrcRelay = { - enable = mkEnableOption (mdDoc "Alertmanager IRC Relay"); + enable = mkEnableOption "Alertmanager IRC Relay"; package = mkPackageOption pkgs "alertmanager-irc-relay" { }; extraFlags = mkOption { type = types.listOf types.str; default = []; - description = mdDoc "Extra command line options to pass to alertmanager-irc-relay."; + description = "Extra command line options to pass to alertmanager-irc-relay."; }; settings = mkOption { @@ -36,7 +36,7 @@ in ]; } ''; - description = mdDoc '' + description = '' Configuration for Alertmanager IRC Relay as a Nix attribute set. For a reference, check out the [example configuration](https://github.com/google/alertmanager-irc-relay#configuring-and-running-the-bot) diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/alertmanager.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/alertmanager.nix index bb426d8b7beb..d1d8f2caaf63 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/alertmanager.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/alertmanager.nix @@ -42,14 +42,14 @@ in { options = { services.prometheus.alertmanager = { - enable = mkEnableOption (lib.mdDoc "Prometheus Alertmanager"); + enable = mkEnableOption "Prometheus Alertmanager"; package = mkPackageOption pkgs "prometheus-alertmanager" { }; configuration = mkOption { type = types.nullOr types.attrs; default = null; - description = lib.mdDoc '' + description = '' Alertmanager configuration as nix attribute set. ''; }; @@ -57,7 +57,7 @@ in { configText = mkOption { type = types.nullOr types.lines; default = null; - description = lib.mdDoc '' + description = '' Alertmanager configuration as YAML text. If non-null, this option defines the text that is written to alertmanager.yml. If null, the contents of alertmanager.yml is generated from the structured config @@ -68,7 +68,7 @@ in { checkConfig = mkOption { type = types.bool; default = true; - description = lib.mdDoc '' + description = '' Check configuration with `amtool check-config`. The call to `amtool` is subject to sandboxing by Nix. @@ -82,7 +82,7 @@ in { logFormat = mkOption { type = types.nullOr types.str; default = null; - description = lib.mdDoc '' + description = '' If set use a syslog logger or JSON logging. ''; }; @@ -90,7 +90,7 @@ in { logLevel = mkOption { type = types.enum ["debug" "info" "warn" "error" "fatal"]; default = "warn"; - description = lib.mdDoc '' + description = '' Only log messages with the given severity or above. ''; }; @@ -98,7 +98,7 @@ in { webExternalUrl = mkOption { type = types.nullOr types.str; default = null; - description = lib.mdDoc '' + description = '' The URL under which Alertmanager is externally reachable (for example, if Alertmanager is served via a reverse proxy). Used for generating relative and absolute links back to Alertmanager itself. If the URL has a path portion, it will be used to prefix all HTTP endoints served by Alertmanager. @@ -109,7 +109,7 @@ in { listenAddress = mkOption { type = types.str; default = ""; - description = lib.mdDoc '' + description = '' Address to listen on for the web interface and API. Empty string will listen on all interfaces. "localhost" will listen on 127.0.0.1 (but not ::1). ''; @@ -118,7 +118,7 @@ in { port = mkOption { type = types.port; default = 9093; - description = lib.mdDoc '' + description = '' Port to listen on for the web interface and API. ''; }; @@ -126,7 +126,7 @@ in { openFirewall = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Open port in firewall for incoming connections. ''; }; @@ -134,7 +134,7 @@ in { clusterPeers = mkOption { type = types.listOf types.str; default = []; - description = lib.mdDoc '' + description = '' Initial peers for HA cluster. ''; }; @@ -142,7 +142,7 @@ in { extraFlags = mkOption { type = types.listOf types.str; default = []; - description = lib.mdDoc '' + description = '' Extra commandline options when launching the Alertmanager. ''; }; @@ -151,7 +151,7 @@ in { type = types.nullOr types.path; default = null; example = "/root/alertmanager.env"; - description = lib.mdDoc '' + description = '' File to load as environment file. Environment variables from this file will be interpolated into the config file using envsubst with this syntax: diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/default.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/default.nix index b4ac8e21451a..7e707a13b790 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/default.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/default.nix @@ -110,7 +110,7 @@ let mkOpt = type: description: mkOption { type = types.nullOr type; default = null; - description = lib.mdDoc description; + description = description; }; mkSdConfigModule = extraOptions: types.submodule { @@ -188,7 +188,7 @@ let options = { username = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' HTTP username ''; }; @@ -255,13 +255,13 @@ let authorization = mkOption { type = types.nullOr types.attrs; default = null; - description = lib.mdDoc '' + description = '' Sets the `Authorization` header on every scrape request with the configured credentials. ''; }; job_name = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' The job name assigned to scraped metrics by default. ''; }; @@ -516,7 +516,7 @@ let subscription_id = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' The subscription ID. ''; }; @@ -537,7 +537,7 @@ let Refresh interval to re-read the instance list. ''; - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from. If using the public IP address, this must instead be specified in the relabeling rule. @@ -609,7 +609,7 @@ let }; promTypes.digitalocean_sd_config = mkSdConfigModule { - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from. ''; @@ -621,12 +621,12 @@ let mkDockerSdConfigModule = extraOptions: mkSdConfigModule ({ host = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Address of the Docker daemon. ''; }; - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from, when `role` is nodes, and for discovered tasks and services that don't have published ports. ''; @@ -636,7 +636,7 @@ let options = { name = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Name of the filter. The available filters are listed in the upstream documentation: Services: <https://docs.docker.com/engine/api/v1.40/#operation/ServiceList> Tasks: <https://docs.docker.com/engine/api/v1.40/#operation/TaskList> @@ -645,7 +645,7 @@ let }; values = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Value for the filter. ''; }; @@ -668,7 +668,7 @@ let promTypes.dockerswarm_sd_config = mkDockerSdConfigModule { role = mkOption { type = types.enum [ "services" "tasks" "nodes" ]; - description = lib.mdDoc '' + description = '' Role of the targets to retrieve. Must be `services`, `tasks`, or `nodes`. ''; }; @@ -678,7 +678,7 @@ let options = { names = mkOption { type = types.listOf types.str; - description = lib.mdDoc '' + description = '' A list of DNS SRV record names to be queried. ''; }; @@ -687,7 +687,7 @@ let The type of DNS query to perform. One of SRV, A, or AAAA. ''; - port = mkOpt types.int '' + port = mkOpt types.port '' The port number used if the query type is not SRV. ''; @@ -701,7 +701,7 @@ let options = { region = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' The AWS Region. If blank, the region from the instance metadata is used. ''; }; @@ -731,7 +731,7 @@ let Refresh interval to re-read the instance list. ''; - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from. If using the public IP address, this must instead be specified in the relabeling rule. @@ -742,7 +742,7 @@ let options = { name = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' See [this list](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html) for the available filters. ''; @@ -751,7 +751,7 @@ let values = mkOption { type = types.listOf types.str; default = [ ]; - description = lib.mdDoc '' + description = '' Value of the filter. ''; }; @@ -765,7 +765,7 @@ let promTypes.eureka_sd_config = mkSdConfigModule { server = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' The URL to connect to the Eureka server. ''; }; @@ -775,7 +775,7 @@ let options = { files = mkOption { type = types.listOf types.str; - description = lib.mdDoc '' + description = '' Patterns for files from which target groups are extracted. Refer to the Prometheus documentation for permitted filename patterns and formats. @@ -794,14 +794,14 @@ let # required configuration values for `gce_sd_config`. project = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' The GCP Project. ''; }; zone = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' The zone of the scrape targets. If you need multiple zones use multiple gce_sd_configs. ''; @@ -834,13 +834,13 @@ let promTypes.hetzner_sd_config = mkSdConfigModule { role = mkOption { type = types.enum [ "robot" "hcloud" ]; - description = lib.mdDoc '' + description = '' The Hetzner role of entities that should be discovered. One of `robot` or `hcloud`. ''; }; - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from. ''; @@ -853,7 +853,7 @@ let options = { url = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' URL from which the targets are fetched. ''; }; @@ -890,7 +890,7 @@ let role = mkOption { type = types.enum [ "endpoints" "service" "pod" "node" "ingress" ]; - description = lib.mdDoc '' + description = '' The Kubernetes role of entities that should be discovered. One of endpoints, service, pod, node, or ingress. ''; @@ -921,7 +921,7 @@ let options = { role = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Selector role ''; }; @@ -955,7 +955,7 @@ let promTypes.kuma_sd_config = mkSdConfigModule { server = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Address of the Kuma Control Plane's MADS xDS server. ''; }; @@ -999,7 +999,7 @@ let Refresh interval to re-read the instance list. ''; - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from. If using the public IP address, this must instead be specified in the relabeling rule. ''; @@ -1007,7 +1007,7 @@ let }; promTypes.linode_sd_config = mkSdConfigModule { - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from. ''; @@ -1023,7 +1023,7 @@ let promTypes.marathon_sd_config = mkSdConfigModule { servers = mkOption { type = types.listOf types.str; - description = lib.mdDoc '' + description = '' List of URLs to be used to contact Marathon servers. You need to provide at least one server URL. ''; }; @@ -1049,14 +1049,14 @@ let options = { servers = mkOption { type = types.listOf types.str; - description = lib.mdDoc '' + description = '' The Zookeeper servers. ''; }; paths = mkOption { type = types.listOf types.str; - description = lib.mdDoc '' + description = '' Paths can point to a single service, or the root of a tree of services. ''; }; @@ -1098,14 +1098,14 @@ let { role = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' The OpenStack role of entities that should be discovered. ''; }; region = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' The OpenStack Region. ''; }; @@ -1148,7 +1148,7 @@ let Refresh interval to re-read the instance list. ''; - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from. If using the public IP address, this must instead be specified in the relabeling rule. ''; @@ -1166,14 +1166,14 @@ let promTypes.puppetdb_sd_config = mkSdConfigModule { url = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' The URL of the PuppetDB root query endpoint. ''; }; query = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Puppet Query Language (PQL) query. Only resources are supported. https://puppet.com/docs/puppetdb/latest/api/query/v4/pql.html ''; @@ -1193,7 +1193,7 @@ let Refresh interval to re-read the resources list. ''; - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from. ''; }; @@ -1202,7 +1202,7 @@ let options = { access_key = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Access key to use. https://console.scaleway.com/project/credentials ''; }; @@ -1219,19 +1219,19 @@ let project_id = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Project ID of the targets. ''; }; role = mkOption { type = types.enum [ "instance" "baremetal" ]; - description = lib.mdDoc '' + description = '' Role of the targets to retrieve. Must be `instance` or `baremetal`. ''; }; - port = mkDefOpt types.int "80" '' + port = mkDefOpt types.port "80" '' The port to scrape metrics from. ''; @@ -1276,7 +1276,7 @@ let options = { account = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' The account to use for discovering new targets. ''; }; @@ -1289,14 +1289,14 @@ let dns_suffix = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' The DNS suffix which should be applied to target. ''; }; endpoint = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' The Triton discovery endpoint (e.g. `cmon.us-east-3b.triton.zone`). This is often the same value as dns_suffix. ''; @@ -1307,7 +1307,7 @@ let If omitted all containers owned by the requesting account are scraped. ''; - port = mkDefOpt types.int "9163" '' + port = mkDefOpt types.port "9163" '' The port to use for discovery and metric scraping. ''; @@ -1328,21 +1328,21 @@ let promTypes.uyuni_sd_config = mkSdConfigModule { server = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' The URL to connect to the Uyuni server. ''; }; username = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Credentials are used to authenticate the requests to Uyuni API. ''; }; password = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Credentials are used to authenticate the requests to Uyuni API. ''; }; @@ -1364,14 +1364,14 @@ let options = { targets = mkOption { type = types.listOf types.str; - description = lib.mdDoc '' + description = '' The targets specified by the target group. ''; }; labels = mkOption { type = types.attrsOf types.str; default = { }; - description = lib.mdDoc '' + description = '' Labels assigned to all metrics scraped from the targets. ''; }; @@ -1427,7 +1427,7 @@ let options = { url = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' ServerName extension to indicate the name of the server. http://tools.ietf.org/html/rfc4366#section-3.1 ''; @@ -1517,7 +1517,7 @@ let options = { url = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' ServerName extension to indicate the name of the server. http://tools.ietf.org/html/rfc4366#section-3.1 ''; @@ -1575,14 +1575,14 @@ in options.services.prometheus = { - enable = mkEnableOption (lib.mdDoc "Prometheus monitoring daemon"); + enable = mkEnableOption "Prometheus monitoring daemon"; package = mkPackageOption pkgs "prometheus" { }; port = mkOption { type = types.port; default = 9090; - description = lib.mdDoc '' + description = '' Port to listen on. ''; }; @@ -1590,7 +1590,7 @@ in listenAddress = mkOption { type = types.str; default = "0.0.0.0"; - description = lib.mdDoc '' + description = '' Address to listen on for the web interface, API, and telemetry. ''; }; @@ -1598,7 +1598,7 @@ in stateDir = mkOption { type = types.str; default = "prometheus2"; - description = lib.mdDoc '' + description = '' Directory below `/var/lib` to store Prometheus metrics data. This directory will be created automatically using systemd's StateDirectory mechanism. ''; @@ -1607,7 +1607,7 @@ in extraFlags = mkOption { type = types.listOf types.str; default = [ ]; - description = lib.mdDoc '' + description = '' Extra commandline options when launching Prometheus. ''; }; @@ -1615,7 +1615,7 @@ in enableReload = mkOption { default = false; type = types.bool; - description = lib.mdDoc '' + description = '' Reload prometheus when configuration file changes (instead of restart). The following property holds: switching to a configuration @@ -1625,12 +1625,12 @@ in ''; }; - enableAgentMode = mkEnableOption (lib.mdDoc "agent mode"); + enableAgentMode = mkEnableOption "agent mode"; configText = mkOption { type = types.nullOr types.lines; default = null; - description = lib.mdDoc '' + description = '' If non-null, this option defines the text that is written to prometheus.yml. If null, the contents of prometheus.yml is generated from the structured config options. @@ -1640,7 +1640,7 @@ in globalConfig = mkOption { type = promTypes.globalConfig; default = { }; - description = lib.mdDoc '' + description = '' Parameters that are valid in all configuration contexts. They also serve as defaults for other configuration sections ''; @@ -1649,7 +1649,7 @@ in remoteRead = mkOption { type = types.listOf promTypes.remote_read; default = [ ]; - description = lib.mdDoc '' + description = '' Parameters of the endpoints to query from. See [the official documentation](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_read) for more information. ''; @@ -1658,7 +1658,7 @@ in remoteWrite = mkOption { type = types.listOf promTypes.remote_write; default = [ ]; - description = lib.mdDoc '' + description = '' Parameters of the endpoints to send samples to. See [the official documentation](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write) for more information. ''; @@ -1667,7 +1667,7 @@ in rules = mkOption { type = types.listOf types.str; default = [ ]; - description = lib.mdDoc '' + description = '' Alerting and/or Recording rules to evaluate at runtime. ''; }; @@ -1675,7 +1675,7 @@ in ruleFiles = mkOption { type = types.listOf types.path; default = [ ]; - description = lib.mdDoc '' + description = '' Any additional rules files to include in this configuration. ''; }; @@ -1683,7 +1683,7 @@ in scrapeConfigs = mkOption { type = types.listOf promTypes.scrape_config; default = [ ]; - description = lib.mdDoc '' + description = '' A list of scrape configurations. ''; }; @@ -1702,7 +1702,7 @@ in } ] ''; default = [ ]; - description = lib.mdDoc '' + description = '' A list of alertmanagers to send alerts to. See [the official documentation](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alertmanager_config) for more information. ''; @@ -1711,7 +1711,7 @@ in alertmanagerNotificationQueueCapacity = mkOption { type = types.int; default = 10000; - description = lib.mdDoc '' + description = '' The capacity of the queue for pending alert manager notifications. ''; }; @@ -1720,7 +1720,7 @@ in type = types.nullOr types.str; default = null; example = "https://example.com/"; - description = lib.mdDoc '' + description = '' The URL under which Prometheus is externally reachable (for example, if Prometheus is served via a reverse proxy). ''; @@ -1729,7 +1729,7 @@ in webConfigFile = mkOption { type = types.nullOr types.path; default = null; - description = lib.mdDoc '' + description = '' Specifies which file should be used as web.config.file and be passed on startup. See https://prometheus.io/docs/prometheus/latest/configuration/https/ for valid options. ''; @@ -1739,7 +1739,7 @@ in type = with types; either bool (enum [ "syntax-only" ]); default = true; example = "syntax-only"; - description = lib.mdDoc '' + description = '' Check configuration with `promtool check`. The call to `promtool` is subject to sandboxing by Nix. @@ -1756,7 +1756,7 @@ in type = types.nullOr types.str; default = null; example = "15d"; - description = lib.mdDoc '' + description = '' How long to retain samples in storage. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters.md b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters.md index b344534f6aee..d291020d3673 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters.md +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters.md @@ -72,6 +72,7 @@ example: - `extraFlags` - `openFirewall` - `firewallFilter` + - `firewallRules` - `user` - `group` - As there is already a package available, the module can now be added. This diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters.nix index 8c5ec2992eda..2dc12a221bf0 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters.nix @@ -31,6 +31,7 @@ let "collectd" "dmarc" "dnsmasq" + "dnssec" "domain" "dovecot" "fastly" @@ -55,6 +56,7 @@ let "modemmanager" "mongodb" "mysqld" + "nats" "nextcloud" "nginx" "nginxlog" @@ -128,32 +130,32 @@ let ); mkExporterOpts = ({ name, port }: { - enable = mkEnableOption (lib.mdDoc "the prometheus ${name} exporter"); + enable = mkEnableOption "the prometheus ${name} exporter"; port = mkOption { type = types.port; default = port; - description = lib.mdDoc '' + description = '' Port to listen on. ''; }; listenAddress = mkOption { type = types.str; default = "0.0.0.0"; - description = lib.mdDoc '' + description = '' Address to listen on. ''; }; extraFlags = mkOption { type = types.listOf types.str; default = []; - description = lib.mdDoc '' + description = '' Extra commandline options to pass to the ${name} exporter. ''; }; openFirewall = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Open port in firewall for incoming connections. ''; }; @@ -163,23 +165,34 @@ let example = literalExpression '' "-i eth0 -p tcp -m tcp --dport ${toString port}" ''; - description = lib.mdDoc '' + description = '' Specify a filter for iptables to use when {option}`services.prometheus.exporters.${name}.openFirewall` is true. It is used as `ip46tables -I nixos-fw firewallFilter -j nixos-fw-accept`. ''; }; + firewallRules = mkOption { + type = types.nullOr types.lines; + default = null; + example = literalExpression '' + iifname "eth0" tcp dport ${toString port} counter accept + ''; + description = '' + Specify rules for nftables to add to the input chain + when {option}`services.prometheus.exporters.${name}.openFirewall` is true. + ''; + }; user = mkOption { type = types.str; default = "${name}-exporter"; - description = lib.mdDoc '' + description = '' User name under which the ${name} exporter shall be run. ''; }; group = mkOption { type = types.str; default = "${name}-exporter"; - description = lib.mdDoc '' + description = '' Group under which the ${name} exporter shall be run. ''; }; @@ -194,6 +207,7 @@ let } // extraOpts); } ({ config, ... }: mkIf config.openFirewall { firewallFilter = mkDefault "-p tcp -m tcp --dport ${toString config.port}"; + firewallRules = mkDefault ''tcp dport ${toString config.port} accept comment "${name}-exporter"''; })]; internal = true; default = {}; @@ -212,6 +226,7 @@ let mkExporterConf = { name, conf, serviceOpts }: let enableDynamicUser = serviceOpts.serviceConfig.DynamicUser or true; + nftables = config.networking.nftables.enable; in mkIf conf.enable { warnings = conf.warnings or []; @@ -223,10 +238,11 @@ let users.groups = (mkIf (conf.group == "${name}-exporter" && !enableDynamicUser) { "${name}-exporter" = {}; }); - networking.firewall.extraCommands = mkIf conf.openFirewall (concatStrings [ + networking.firewall.extraCommands = mkIf (conf.openFirewall && !nftables) (concatStrings [ "ip46tables -A nixos-fw ${conf.firewallFilter} " "-m comment --comment ${name}-exporter -j nixos-fw-accept" ]); + networking.firewall.extraInputRules = mkIf (conf.openFirewall && nftables) conf.firewallRules; systemd.services."prometheus-${name}-exporter" = mkMerge ([{ wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; @@ -279,7 +295,7 @@ in (lib.mkRenamedOptionModule [ "unifi-poller" ] [ "unpoller" ]) ]; }; - description = lib.mdDoc "Prometheus exporter configuration"; + description = "Prometheus exporter configuration"; default = {}; example = literalExpression '' { diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/apcupsd.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/apcupsd.nix index de6cda18bc37..f188fe1f68fb 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/apcupsd.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/apcupsd.nix @@ -1,9 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.apcupsd; + inherit (lib) mkOption types concatStringsSep; in { port = 9162; @@ -11,7 +10,7 @@ in apcupsdAddress = mkOption { type = types.str; default = ":3551"; - description = lib.mdDoc '' + description = '' Address of the apcupsd Network Information Server (NIS). ''; }; @@ -19,7 +18,7 @@ in apcupsdNetwork = mkOption { type = types.enum ["tcp" "tcp4" "tcp6"]; default = "tcp"; - description = lib.mdDoc '' + description = '' Network of the apcupsd Network Information Server (NIS): one of "tcp", "tcp4", or "tcp6". ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/artifactory.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/artifactory.nix index b3afdb596686..e98982c0dd31 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/artifactory.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/artifactory.nix @@ -1,9 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.artifactory; + inherit (lib) mkOption types concatStringsSep; in { port = 9531; @@ -11,14 +10,14 @@ in scrapeUri = mkOption { type = types.str; default = "http://localhost:8081/artifactory"; - description = lib.mdDoc '' + description = '' URI on which to scrape JFrog Artifactory. ''; }; artiUsername = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Username for authentication against JFrog Artifactory API. ''; }; @@ -26,7 +25,7 @@ in artiPassword = mkOption { type = types.str; default = ""; - description = lib.mdDoc '' + description = '' Password for authentication against JFrog Artifactory API. One of the password or access token needs to be set. ''; @@ -35,7 +34,7 @@ in artiAccessToken = mkOption { type = types.str; default = ""; - description = lib.mdDoc '' + description = '' Access token for authentication against JFrog Artifactory API. One of the password or access token needs to be set. ''; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/bind.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/bind.nix index 100446c1a4eb..1c7dcf8b1ef0 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/bind.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/bind.nix @@ -1,9 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.bind; + inherit (lib) mkOption types concatStringsSep; in { port = 9119; @@ -11,28 +10,28 @@ in bindURI = mkOption { type = types.str; default = "http://localhost:8053/"; - description = lib.mdDoc '' + description = '' HTTP XML API address of an Bind server. ''; }; bindTimeout = mkOption { type = types.str; default = "10s"; - description = lib.mdDoc '' + description = '' Timeout for trying to get stats from Bind. ''; }; bindVersion = mkOption { type = types.enum [ "xml.v2" "xml.v3" "auto" ]; default = "auto"; - description = lib.mdDoc '' + description = '' BIND statistics version. Can be detected automatically. ''; }; bindGroups = mkOption { type = types.listOf (types.enum [ "server" "view" "tasks" ]); default = [ "server" "view" ]; - description = lib.mdDoc '' + description = '' List of statistics to collect. Available: [server, view, tasks] ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/bird.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/bird.nix index fc52135e3b45..5d91eeed106d 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/bird.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/bird.nix @@ -1,9 +1,13 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.bird; + inherit (lib) + mkOption + types + concatStringsSep + singleton + ; in { port = 9324; @@ -11,21 +15,21 @@ in birdVersion = mkOption { type = types.enum [ 1 2 ]; default = 2; - description = lib.mdDoc '' + description = '' Specifies whether BIRD1 or BIRD2 is in use. ''; }; birdSocket = mkOption { type = types.path; default = "/run/bird/bird.ctl"; - description = lib.mdDoc '' + description = '' Path to BIRD2 (or BIRD1 v4) socket. ''; }; newMetricFormat = mkOption { type = types.bool; default = true; - description = lib.mdDoc '' + description = '' Enable the new more-generic metric format. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/bitcoin.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/bitcoin.nix index 45f00a04a86c..e44140b1f51a 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/bitcoin.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/bitcoin.nix @@ -1,9 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.bitcoin; + inherit (lib) mkOption types concatStringsSep; in { port = 9332; @@ -11,14 +10,14 @@ in rpcUser = mkOption { type = types.str; default = "bitcoinrpc"; - description = lib.mdDoc '' + description = '' RPC user name. ''; }; rpcPasswordFile = mkOption { type = types.path; - description = lib.mdDoc '' + description = '' File containing RPC password. ''; }; @@ -26,7 +25,7 @@ in rpcScheme = mkOption { type = types.enum [ "http" "https" ]; default = "http"; - description = lib.mdDoc '' + description = '' Whether to connect to bitcoind over http or https. ''; }; @@ -34,7 +33,7 @@ in rpcHost = mkOption { type = types.str; default = "localhost"; - description = lib.mdDoc '' + description = '' RPC host. ''; }; @@ -42,7 +41,7 @@ in rpcPort = mkOption { type = types.port; default = 8332; - description = lib.mdDoc '' + description = '' RPC port number. ''; }; @@ -50,7 +49,7 @@ in refreshSeconds = mkOption { type = types.ints.unsigned; default = 300; - description = lib.mdDoc '' + description = '' How often to ask bitcoind for metrics. ''; }; @@ -58,7 +57,7 @@ in extraEnv = mkOption { type = types.attrsOf types.str; default = {}; - description = lib.mdDoc '' + description = '' Extra environment variables for the exporter. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/blackbox.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/blackbox.nix index e8399e1bec80..33a1fdc52805 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/blackbox.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/blackbox.nix @@ -1,10 +1,14 @@ { config, lib, pkgs, options, ... }: -with lib; - let logPrefix = "services.prometheus.exporter.blackbox"; cfg = config.services.prometheus.exporters.blackbox; + inherit (lib) + mkOption + types + concatStringsSep + escapeShellArg + ; # This ensures that we can deal with string paths, path types and # store-path strings with context. @@ -35,14 +39,14 @@ in { extraOpts = { configFile = mkOption { type = types.path; - description = lib.mdDoc '' + description = '' Path to configuration file. ''; }; enableConfigCheck = mkOption { type = types.bool; default = true; - description = lib.mdDoc '' + description = '' Whether to run a correctness check for the configuration file. This depends on the configuration file residing in the nix-store. Paths passed as string will be copied to the store. diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/buildkite-agent.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/buildkite-agent.nix index 6bfadc3b7632..0af1e33b2c44 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/buildkite-agent.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/buildkite-agent.nix @@ -1,9 +1,14 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.buildkite-agent; + inherit (lib) + mkOption + types + concatStringsSep + optionalString + literalExpression + ; in { port = 9876; @@ -11,7 +16,7 @@ in tokenPath = mkOption { type = types.nullOr types.path; apply = final: if final == null then null else toString final; - description = lib.mdDoc '' + description = '' The token from your Buildkite "Agents" page. A run-time path to the token file, which is supposed to be provisioned @@ -22,14 +27,14 @@ in type = types.str; default = "30s"; example = "1min"; - description = lib.mdDoc '' + description = '' How often to update metrics. ''; }; endpoint = mkOption { type = types.str; default = "https://agent.buildkite.com/v3"; - description = lib.mdDoc '' + description = '' The Buildkite Agent API endpoint. ''; }; @@ -37,7 +42,7 @@ in type = with types; nullOr (listOf str); default = null; example = literalExpression ''[ "my-queue1" "my-queue2" ]''; - description = lib.mdDoc '' + description = '' Which specific queues to process. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/collectd.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/collectd.nix index 3b2b123bbd07..6f4c936fd409 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/collectd.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/collectd.nix @@ -1,32 +1,38 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.collectd; + inherit (lib) + mkOption + mkEnableOption + types + optionalString + concatStringsSep + escapeShellArg + ; in { port = 9103; extraOpts = { collectdBinary = { - enable = mkEnableOption (lib.mdDoc "collectd binary protocol receiver"); + enable = mkEnableOption "collectd binary protocol receiver"; authFile = mkOption { default = null; type = types.nullOr types.path; - description = lib.mdDoc "File mapping user names to pre-shared keys (passwords)."; + description = "File mapping user names to pre-shared keys (passwords)."; }; port = mkOption { type = types.port; default = 25826; - description = lib.mdDoc "Network address on which to accept collectd binary network packets."; + description = "Network address on which to accept collectd binary network packets."; }; listenAddress = mkOption { type = types.str; default = "0.0.0.0"; - description = lib.mdDoc '' + description = '' Address to listen on for binary network packets. ''; }; @@ -34,7 +40,7 @@ in securityLevel = mkOption { type = types.enum ["None" "Sign" "Encrypt"]; default = "None"; - description = lib.mdDoc '' + description = '' Minimum required security level for accepted packets. ''; }; @@ -44,7 +50,7 @@ in type = types.enum [ "logfmt" "json" ]; default = "logfmt"; example = "json"; - description = lib.mdDoc '' + description = '' Set the log format. ''; }; @@ -52,7 +58,7 @@ in logLevel = mkOption { type = types.enum ["debug" "info" "warn" "error" "fatal"]; default = "info"; - description = lib.mdDoc '' + description = '' Only log messages with the given severity or above. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/dmarc.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/dmarc.nix index a4a917b473ce..3674fab1e4f8 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/dmarc.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/dmarc.nix @@ -1,9 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.dmarc; + inherit (lib) mkOption types optionalString; json = builtins.toJSON { inherit (cfg) folders port; @@ -24,28 +23,28 @@ in { host = mkOption { type = types.str; default = "localhost"; - description = lib.mdDoc '' + description = '' Hostname of IMAP server to connect to. ''; }; port = mkOption { type = types.port; default = 993; - description = lib.mdDoc '' + description = '' Port of the IMAP server to connect to. ''; }; username = mkOption { type = types.str; example = "postmaster@example.org"; - description = lib.mdDoc '' + description = '' Login username for the IMAP connection. ''; }; passwordFile = mkOption { type = types.str; example = "/run/secrets/dovecot_pw"; - description = lib.mdDoc '' + description = '' File containing the login password for the IMAP connection. ''; }; @@ -54,21 +53,21 @@ in { inbox = mkOption { type = types.str; default = "INBOX"; - description = lib.mdDoc '' + description = '' IMAP mailbox that is checked for incoming DMARC aggregate reports ''; }; done = mkOption { type = types.str; default = "Archive"; - description = lib.mdDoc '' + description = '' IMAP mailbox that successfully processed reports are moved to. ''; }; error = mkOption { type = types.str; default = "Invalid"; - description = lib.mdDoc '' + description = '' IMAP mailbox that emails are moved to that could not be processed. ''; }; @@ -76,7 +75,7 @@ in { pollIntervalSeconds = mkOption { type = types.ints.unsigned; default = 60; - description = lib.mdDoc '' + description = '' How often to poll the IMAP server in seconds. ''; }; @@ -84,7 +83,7 @@ in { type = types.ints.unsigned; default = 604800; defaultText = "7 days (in seconds)"; - description = lib.mdDoc '' + description = '' How long individual report IDs will be remembered to avoid counting double delivered reports twice. ''; @@ -92,7 +91,7 @@ in { debug = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Whether to declare enable `--debug`. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/dnsmasq.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/dnsmasq.nix index 4cfee7c54a41..ba438ea74a3b 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/dnsmasq.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/dnsmasq.nix @@ -1,9 +1,13 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.dnsmasq; + inherit (lib) + mkOption + types + concatStringsSep + escapeShellArg + ; in { port = 9153; @@ -11,7 +15,7 @@ in dnsmasqListenAddress = mkOption { type = types.str; default = "localhost:53"; - description = lib.mdDoc '' + description = '' Address on which dnsmasq listens. ''; }; @@ -19,7 +23,7 @@ in type = types.path; default = "/var/lib/misc/dnsmasq.leases"; example = "/var/lib/dnsmasq/dnsmasq.leases"; - description = lib.mdDoc '' + description = '' Path to the `dnsmasq.leases` file. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/dnssec.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/dnssec.nix new file mode 100644 index 000000000000..dda1ad1988a6 --- /dev/null +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/dnssec.nix @@ -0,0 +1,90 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.services.prometheus.exporters.dnssec; + configFormat = pkgs.formats.toml { }; + configFile = configFormat.generate "dnssec-checks.toml" cfg.configuration; +in { + port = 9204; + extraOpts = { + configuration = lib.mkOption { + type = lib.types.nullOr lib.types.attrs; + default = null; + description = '' + dnssec exporter configuration as nix attribute set. + + See <https://github.com/chrj/prometheus-dnssec-exporter/blob/master/README.md> + for the description of the configuration file format. + ''; + example = lib.literalExpression '' + { + records = [ + { + zone = "ietf.org"; + record = "@"; + type = "SOA"; + } + { + zone = "verisigninc.com"; + record = "@"; + type = "SOA"; + } + ]; + } + ''; + }; + + listenAddress = lib.mkOption { + type = lib.types.nullOr lib.types.str; + default = null; + description = '' + Listen address as host IP and port definition. + ''; + example = ":9204"; + }; + + resolvers = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; + description = '' + DNSSEC capable resolver to be used for the check. + ''; + example = [ "0.0.0.0:53" ]; + }; + + timeout = lib.mkOption { + type = lib.types.nullOr lib.types.str; + default = null; + description = '' + DNS request timeout duration. + ''; + example = "10s"; + }; + + extraFlags = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; + description = '' + Extra commandline options when launching Prometheus. + ''; + }; + }; + + serviceOpts = { + serviceConfig = let + startScript = pkgs.writeShellScriptBin "prometheus-dnssec-exporter-start" + "${lib.concatStringsSep " " + ([ "${pkgs.prometheus-dnssec-exporter}/bin/prometheus-dnssec-exporter" ] + ++ lib.optionals (cfg.configuration != null) + [ "-config ${configFile}" ] + ++ lib.optionals (cfg.listenAddress != null) + [ "-listen-address ${lib.escapeShellArg cfg.listenAddress}" ] + ++ lib.optionals (cfg.resolvers != [ ]) [ + "-resolvers ${ + lib.escapeShellArg (lib.concatStringsSep "," cfg.resolvers) + }" + ] ++ lib.optionals (cfg.timeout != null) + [ "-timeout ${lib.escapeShellArg cfg.timeout}" ] ++ cfg.extraFlags)}"; + in { ExecStart = lib.getExe startScript; }; + }; +} + diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/domain.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/domain.nix index b2c8e6664c0f..c271a040d288 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/domain.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/domain.nix @@ -1,9 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.domain; + inherit (lib) concatStringsSep; in { port = 9222; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/dovecot.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/dovecot.nix index df6b1ef3200c..f11e91fd761a 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/dovecot.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/dovecot.nix @@ -1,9 +1,13 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.dovecot; + inherit (lib) + mkOption + types + escapeShellArg + concatStringsSep + ; in { port = 9166; @@ -11,7 +15,7 @@ in telemetryPath = mkOption { type = types.str; default = "/metrics"; - description = lib.mdDoc '' + description = '' Path under which to expose metrics. ''; }; @@ -19,7 +23,7 @@ in type = types.path; default = "/var/run/dovecot/stats"; example = "/var/run/dovecot2/old-stats"; - description = lib.mdDoc '' + description = '' Path under which the stats socket is placed. The user/group under which the exporter runs, should be able to access the socket in order @@ -67,7 +71,7 @@ in type = types.listOf types.str; default = [ "user" ]; example = [ "user" "global" ]; - description = lib.mdDoc '' + description = '' Stats scopes to query. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/exportarr.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/exportarr.nix index c632b0290262..45c2c697519c 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/exportarr.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/exportarr.nix @@ -16,7 +16,7 @@ in url = lib.mkOption { type = lib.types.str; default = "http://127.0.0.1"; - description = lib.mdDoc '' + description = '' The full URL to Sonarr, Radarr, or Lidarr. ''; }; @@ -24,7 +24,7 @@ in apiKeyFile = lib.mkOption { type = lib.types.nullOr lib.types.path; default = null; - description = lib.mdDoc '' + description = '' File containing the api-key. ''; }; @@ -34,7 +34,7 @@ in environment = lib.mkOption { type = lib.types.attrsOf lib.types.str; default = { }; - description = lib.mdDoc '' + description = '' See [the configuration guide](https://github.com/onedr0p/exportarr#configuration) for available options. ''; example = { diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/flow.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/flow.nix index 42292abeada2..7719215952a5 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/flow.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/flow.nix @@ -1,28 +1,33 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.flow; + inherit (lib) + mkOption + types + literalExpression + concatStringsSep + optionalString + ; in { port = 9590; extraOpts = { brokers = mkOption { type = types.listOf types.str; example = literalExpression ''[ "kafka.example.org:19092" ]''; - description = lib.mdDoc "List of Kafka brokers to connect to."; + description = "List of Kafka brokers to connect to."; }; asn = mkOption { type = types.ints.positive; example = 65542; - description = lib.mdDoc "The ASN being monitored."; + description = "The ASN being monitored."; }; partitions = mkOption { type = types.listOf types.int; default = []; - description = lib.mdDoc '' + description = '' The number of the partitions to consume, none means all. ''; }; @@ -30,7 +35,7 @@ in { topic = mkOption { type = types.str; example = "pmacct.acct"; - description = lib.mdDoc "The Kafka topic to consume from."; + description = "The Kafka topic to consume from."; }; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/fritz.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/fritz.nix index c3a962b576a5..fcf7e8784f60 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/fritz.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/fritz.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, utils, ... }: let - inherit (lib) mkOption types mdDoc; + inherit (lib) mkOption types; cfg = config.services.prometheus.exporters.fritz; yaml = pkgs.formats.yaml { }; configFile = yaml.generate "fritz-exporter.yaml" cfg.settings; @@ -10,7 +10,7 @@ in extraOpts = { settings = mkOption { - description = mdDoc "Configuration settings for fritz-exporter."; + description = "Configuration settings for fritz-exporter."; type = types.submodule { freeformType = yaml.type; @@ -32,7 +32,7 @@ in log_level = mkOption { type = types.enum [ "DEBUG" "INFO" "WARNING" "ERROR" "CRITICAL" ]; default = "INFO"; - description = mdDoc '' + description = '' Log level to use for the exporter. ''; }; @@ -46,33 +46,33 @@ in name = mkOption { type = types.str; default = ""; - description = mdDoc '' + description = '' Name to use for the device. ''; }; hostname = mkOption { type = types.str; default = "fritz.box"; - description = mdDoc '' + description = '' Hostname under which the target device is reachable. ''; }; username = mkOption { type = types.str; - description = mdDoc '' + description = '' Username to authenticate with the target device. ''; }; password_file = mkOption { type = types.path; - description = mdDoc '' + description = '' Path to a file which contains the password to authenticate with the target device. Needs to be readable by the user the exporter runs under. ''; }; host_info = mkOption { type = types.bool; - description = mdDoc '' + description = '' Enable extended host info for this device. *Warning*: This will heavily increase scrape time. ''; default = false; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/fritzbox.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/fritzbox.nix index 7b881a8e2693..29470147c13f 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/fritzbox.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/fritzbox.nix @@ -1,9 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.fritzbox; + inherit (lib) mkOption types concatStringsSep; in { port = 9133; @@ -11,7 +10,7 @@ in gatewayAddress = mkOption { type = types.str; default = "fritz.box"; - description = lib.mdDoc '' + description = '' The hostname or IP of the FRITZ!Box. ''; }; @@ -19,7 +18,7 @@ in gatewayPort = mkOption { type = types.int; default = 49000; - description = lib.mdDoc '' + description = '' The port of the FRITZ!Box UPnP service. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/graphite.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/graphite.nix index 07c06afe1409..523a720425c0 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/graphite.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/graphite.nix @@ -10,7 +10,7 @@ in graphitePort = lib.mkOption { type = lib.types.port; default = 9109; - description = lib.mdDoc '' + description = '' Port to use for the graphite server. ''; }; @@ -20,7 +20,7 @@ in options = { }; }; default = { }; - description = lib.mdDoc '' + description = '' Mapping configuration for the exporter, see <https://github.com/prometheus/graphite_exporter#yaml-config> for available options. diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/idrac.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/idrac.nix index 78ae4826215c..54696187feb1 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/idrac.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/idrac.nix @@ -1,8 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; let cfg = config.services.prometheus.exporters.idrac; + inherit (lib) mkOption types; configFile = if cfg.configurationPath != null then cfg.configurationPath @@ -15,7 +15,7 @@ in type = with types; nullOr path; default = null; example = "/etc/prometheus-idrac-exporter/idrac.yml"; - description = lib.mdDoc '' + description = '' Path to the service's config file. This path can either be a computed path in /nix/store or a path in the local filesystem. The config file should NOT be stored in /nix/store as it will contain passwords and/or keys in plain text. @@ -27,7 +27,7 @@ in }; configuration = mkOption { type = types.nullOr types.attrs; - description = lib.mdDoc '' + description = '' Configuration for iDRAC exporter, as a nix attribute set. Configuration reference: https://github.com/mrlhansen/idrac_exporter/#configuration diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/imap-mailstat.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/imap-mailstat.nix index 68fc63e40fcd..92d02a3f1463 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/imap-mailstat.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/imap-mailstat.nix @@ -1,7 +1,5 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.imap-mailstat; valueToString = value: @@ -13,6 +11,15 @@ let else "XXX ${toString value}" ) ); + inherit (lib) + mkOption + types + concatStrings + concatStringsSep + attrValues + mapAttrs + optionalString + ; createConfigFile = accounts: # unfortunately on toTOML yet # https://github.com/NixOS/nix/issues/3929 @@ -22,7 +29,7 @@ let mkOpt = type: description: mkOption { type = types.nullOr type; default = null; - description = lib.mdDoc description; + description = description; }; accountOptions.options = { mailaddress = mkOpt types.str "Your email address (at the moment used as login name)"; @@ -39,21 +46,21 @@ in oldestUnseenDate = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Enable metric with timestamp of oldest unseen mail ''; }; accounts = mkOption { type = types.attrsOf (types.submodule accountOptions); default = {}; - description = lib.mdDoc '' + description = '' Accounts to monitor ''; }; configurationFile = mkOption { type = types.path; example = "/path/to/config-file"; - description = lib.mdDoc '' + description = '' File containing the configuration ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/influxdb.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/influxdb.nix index d0d7f16bdadf..3a5680439d4c 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/influxdb.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/influxdb.nix @@ -1,9 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.influxdb; + inherit (lib) mkOption types concatStringsSep; in { port = 9122; @@ -12,13 +11,13 @@ in type = types.str; default = "5m"; example = "10m"; - description = lib.mdDoc "How long a sample is valid for"; + description = "How long a sample is valid for"; }; udpBindAddress = mkOption { type = types.str; default = ":9122"; example = "192.0.2.1:9122"; - description = lib.mdDoc "Address on which to listen for udp packets"; + description = "Address on which to listen for udp packets"; }; }; serviceOpts = { diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/ipmi.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/ipmi.nix index fe9734d33c7c..51db6059081f 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/ipmi.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/ipmi.nix @@ -1,10 +1,15 @@ { config, lib, pkgs, options, ... }: -with lib; - let logPrefix = "services.prometheus.exporter.ipmi"; cfg = config.services.prometheus.exporters.ipmi; + inherit (lib) + mkOption + types + concatStringsSep + optionals + escapeShellArg + ; in { port = 9290; @@ -12,7 +17,7 @@ in { configFile = mkOption { type = types.nullOr types.path; default = null; - description = lib.mdDoc '' + description = '' Path to configuration file. ''; }; @@ -20,7 +25,7 @@ in { webConfigFile = mkOption { type = types.nullOr types.path; default = null; - description = lib.mdDoc '' + description = '' Path to configuration file that can enable TLS or authentication. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/jitsi.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/jitsi.nix index bc670ba9cc0e..6a6c003c1977 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/jitsi.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/jitsi.nix @@ -1,9 +1,13 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.jitsi; + inherit (lib) + mkOption + types + escapeShellArg + concatStringsSep + ; in { port = 9700; @@ -11,7 +15,7 @@ in url = mkOption { type = types.str; default = "http://localhost:8080/colibri/stats"; - description = lib.mdDoc '' + description = '' Jitsi Videobridge metrics URL to monitor. This is usually /colibri/stats on port 8080 of the jitsi videobridge host. ''; @@ -20,7 +24,7 @@ in type = types.str; default = "30s"; example = "1min"; - description = lib.mdDoc '' + description = '' How often to scrape new data ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/json.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/json.nix index 7f78985d80cd..1c8db0ea3e0b 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/json.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/json.nix @@ -1,16 +1,21 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.json; + inherit (lib) + mkOption + types + escapeShellArg + concatStringsSep + mkRemovedOptionModule + ; in { port = 7979; extraOpts = { configFile = mkOption { type = types.path; - description = lib.mdDoc '' + description = '' Path to configuration file. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/junos-czerwonk.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/junos-czerwonk.nix index 72119d17fcb7..3519cce6e821 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/junos-czerwonk.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/junos-czerwonk.nix @@ -1,9 +1,14 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.junos-czerwonk; + inherit (lib) + mkOption + types + escapeShellArg + mkIf + concatStringsSep + ; configFile = if cfg.configuration != null then configurationFile else (escapeShellArg cfg.configurationFile); @@ -15,21 +20,21 @@ in environmentFile = mkOption { type = types.nullOr types.str; default = null; - description = lib.mdDoc '' + description = '' File containing env-vars to be substituted into the exporter's config. ''; }; configurationFile = mkOption { type = types.nullOr types.path; default = null; - description = lib.mdDoc '' + description = '' Specify the JunOS exporter configuration file to use. ''; }; configuration = mkOption { type = types.nullOr types.attrs; default = null; - description = lib.mdDoc '' + description = '' JunOS exporter configuration as nix attribute set. Mutually exclusive with the `configurationFile` option. ''; example = { @@ -44,7 +49,7 @@ in telemetryPath = mkOption { type = types.str; default = "/metrics"; - description = lib.mdDoc '' + description = '' Path under which to expose metrics. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/kea.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/kea.nix index ccfdd98b8db9..d0f2eb6b8a3c 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/kea.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/kea.nix @@ -5,10 +5,14 @@ , ... }: -with lib; - let cfg = config.services.prometheus.exporters.kea; + inherit (lib) + mkOption + types + mkRenamedOptionModule + literalExpression + ; in { imports = [ (mkRenamedOptionModule [ "controlSocketPaths" ] [ "targets" ]) @@ -24,7 +28,7 @@ in { "http://127.0.0.1:8547" ] ''; - description = lib.mdDoc '' + description = '' Paths or URLs to the Kea control socket. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/keylight.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/keylight.nix index afdb664a0de5..44169cce6745 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/keylight.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/keylight.nix @@ -1,9 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.keylight; + inherit (lib) concatStringsSep; in { port = 9288; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/knot.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/knot.nix index 0352aff8b013..ed902fc27c15 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/knot.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/knot.nix @@ -1,9 +1,13 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.knot; + inherit (lib) + mkOption + types + literalExpression + concatStringsSep + ; in { port = 9433; extraOpts = { @@ -11,7 +15,7 @@ in { type = types.nullOr types.str; default = null; example = literalExpression ''"''${pkgs.knot-dns.out}/lib/libknot.so"''; - description = lib.mdDoc '' + description = '' Path to the library of `knot-dns`. ''; }; @@ -19,7 +23,7 @@ in { knotSocketPath = mkOption { type = types.str; default = "/run/knot/knot.sock"; - description = lib.mdDoc '' + description = '' Socket path of {manpage}`knotd(8)`. ''; }; @@ -27,7 +31,7 @@ in { knotSocketTimeout = mkOption { type = types.ints.positive; default = 2000; - description = lib.mdDoc '' + description = '' Timeout in seconds. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/lnd.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/lnd.nix index 66d9c02f904b..edface276f54 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/lnd.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/lnd.nix @@ -1,9 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.lnd; + inherit (lib) mkOption types concatStringsSep; in { port = 9092; @@ -11,21 +10,21 @@ in lndHost = mkOption { type = types.str; default = "localhost:10009"; - description = lib.mdDoc '' + description = '' lnd instance gRPC address:port. ''; }; lndTlsPath = mkOption { type = types.path; - description = lib.mdDoc '' + description = '' Path to lnd TLS certificate. ''; }; lndMacaroonDir = mkOption { type = types.path; - description = lib.mdDoc '' + description = '' Path to lnd macaroons. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mail.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mail.nix index 8c88f47ab86a..f6dd6f7eb994 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mail.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mail.nix @@ -1,9 +1,19 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.mail; + inherit (lib) + mkOption + types + mapAttrs' + nameValuePair + toLower + filterAttrs + escapeShellArg + literalExpression + mkIf + concatStringsSep + ; configFile = if cfg.configuration != null then configurationFile else (escapeShellArg cfg.configFile); @@ -22,41 +32,41 @@ let serverOptions.options = { name = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Value for label 'configname' which will be added to all metrics. ''; }; server = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Hostname of the server that should be probed. ''; }; port = mkOption { type = types.port; example = 587; - description = lib.mdDoc '' + description = '' Port to use for SMTP. ''; }; from = mkOption { type = types.str; example = "exporteruser@domain.tld"; - description = lib.mdDoc '' + description = '' Content of 'From' Header for probing mails. ''; }; to = mkOption { type = types.str; example = "exporteruser@domain.tld"; - description = lib.mdDoc '' + description = '' Content of 'To' Header for probing mails. ''; }; detectionDir = mkOption { type = types.path; example = "/var/spool/mail/exporteruser/new"; - description = lib.mdDoc '' + description = '' Directory in which new mails for the exporter user are placed. Note that this needs to exist when the exporter starts. ''; @@ -65,14 +75,14 @@ let type = types.nullOr types.str; default = null; example = "exporteruser@domain.tld"; - description = lib.mdDoc '' + description = '' Username to use for SMTP authentication. ''; }; passphrase = mkOption { type = types.nullOr types.str; default = null; - description = lib.mdDoc '' + description = '' Password to use for SMTP authentication. ''; }; @@ -82,20 +92,20 @@ let monitoringInterval = mkOption { type = types.str; example = "10s"; - description = lib.mdDoc '' + description = '' Time interval between two probe attempts. ''; }; mailCheckTimeout = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Timeout until mails are considered "didn't make it". ''; }; disableFileDeletion = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Disables the exporter's function to delete probing mails. ''; }; @@ -112,7 +122,7 @@ let detectionDir = "/path/to/Maildir/new"; } ] ''; - description = lib.mdDoc '' + description = '' List of servers that should be probed. *Note:* if your mailserver has {manpage}`rspamd(8)` configured, @@ -141,28 +151,28 @@ in environmentFile = mkOption { type = types.nullOr types.str; default = null; - description = lib.mdDoc '' + description = '' File containing env-vars to be substituted into the exporter's config. ''; }; configFile = mkOption { type = types.nullOr types.path; default = null; - description = lib.mdDoc '' + description = '' Specify the mailexporter configuration file to use. ''; }; configuration = mkOption { type = types.nullOr (types.submodule exporterOptions); default = null; - description = lib.mdDoc '' + description = '' Specify the mailexporter configuration file to use. ''; }; telemetryPath = mkOption { type = types.str; default = "/metrics"; - description = lib.mdDoc '' + description = '' Path under which to expose metrics. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mikrotik.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mikrotik.nix index a8dba75251d8..cd438f13edd2 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mikrotik.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mikrotik.nix @@ -1,9 +1,14 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.mikrotik; + inherit (lib) + mkOption + types + literalExpression + concatStringsSep + escapeShellArg + ; in { port = 9436; @@ -11,7 +16,7 @@ in configFile = mkOption { type = types.nullOr types.path; default = null; - description = lib.mdDoc '' + description = '' Path to a mikrotik exporter configuration file. Mutually exclusive with {option}`configuration` option. ''; @@ -21,7 +26,7 @@ in configuration = mkOption { type = types.nullOr types.attrs; default = null; - description = lib.mdDoc '' + description = '' Mikrotik exporter configuration as nix attribute set. Mutually exclusive with {option}`configFile` option. diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/minio.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/minio.nix index e24d4f766e30..8faff5908b8a 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/minio.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/minio.nix @@ -1,9 +1,14 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.minio; + inherit (lib) + mkOption + types + optionalString + concatStringsSep + escapeShellArg + ; in { port = 9290; @@ -11,7 +16,7 @@ in minioAddress = mkOption { type = types.str; example = "https://10.0.0.1:9000"; - description = lib.mdDoc '' + description = '' The URL of the minio server. Use HTTPS if Minio accepts secure connections only. By default this connects to the local minio server if enabled. @@ -21,7 +26,7 @@ in minioAccessKey = mkOption { type = types.str; example = "yourMinioAccessKey"; - description = lib.mdDoc '' + description = '' The value of the Minio access key. It is required in order to connect to the server. By default this uses the one from the local minio server if enabled @@ -31,7 +36,7 @@ in minioAccessSecret = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' The value of the Minio access secret. It is required in order to connect to the server. By default this uses the one from the local minio server if enabled @@ -42,7 +47,7 @@ in minioBucketStats = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Collect statistics about the buckets and files in buckets. It requires more computation, use it carefully in case of large buckets.. ''; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/modemmanager.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/modemmanager.nix index 0eb193c0021f..37ff49b27000 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/modemmanager.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/modemmanager.nix @@ -1,9 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.modemmanager; + inherit (lib) mkOption types concatStringsSep; in { port = 9539; @@ -11,7 +10,7 @@ in refreshRate = mkOption { type = types.str; default = "5s"; - description = lib.mdDoc '' + description = '' How frequently ModemManager will refresh the extended signal quality information for each modem. The duration should be specified in seconds ("5s"), minutes ("1m"), or hours ("1h"). diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mongodb.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mongodb.nix index 1ed6bbf0325d..288434e93abb 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mongodb.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mongodb.nix @@ -1,9 +1,17 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.mongodb; + inherit (lib) + mkOption + types + optionalString + getExe + length + concatStringsSep + concatMapStringsSep + escapeShellArgs + ; in { port = 9216; @@ -12,13 +20,13 @@ in type = types.str; default = "mongodb://localhost:27017/test"; example = "mongodb://localhost:27017/test"; - description = lib.mdDoc "MongoDB URI to connect to."; + description = "MongoDB URI to connect to."; }; collStats = mkOption { type = types.listOf types.str; default = [ ]; example = [ "db1.coll1" "db2" ]; - description = lib.mdDoc '' + description = '' List of comma separared databases.collections to get $collStats ''; }; @@ -26,7 +34,7 @@ in type = types.listOf types.str; default = [ ]; example = [ "db1.coll1" "db2" ]; - description = lib.mdDoc '' + description = '' List of comma separared databases.collections to get $indexStats ''; }; @@ -34,12 +42,12 @@ in type = types.listOf types.str; default = [ ]; example = [ "diagnosticdata" "replicasetstatus" "dbstats" "topmetrics" "currentopmetrics" "indexstats" "dbstats" "profile" ]; - description = lib.mdDoc "Enabled collectors"; + description = "Enabled collectors"; }; collectAll = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Enable all collectors. Same as specifying all --collector.<name> ''; }; @@ -47,7 +55,7 @@ in type = types.str; default = "/metrics"; example = "/metrics"; - description = lib.mdDoc "Metrics expose path"; + description = "Metrics expose path"; }; }; serviceOpts = { diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mysqld.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mysqld.nix index c6da052ccdf3..5b2c2274f053 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mysqld.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/mysqld.nix @@ -1,14 +1,14 @@ { config, lib, pkgs, options, ... }: let cfg = config.services.prometheus.exporters.mysqld; - inherit (lib) types mkOption mdDoc mkIf mkForce cli concatStringsSep optionalString escapeShellArgs; + inherit (lib) types mkOption mkIf mkForce cli concatStringsSep optionalString escapeShellArgs; in { port = 9104; extraOpts = { telemetryPath = mkOption { type = types.str; default = "/metrics"; - description = mdDoc '' + description = '' Path under which to expose metrics. ''; }; @@ -16,7 +16,7 @@ in { runAsLocalSuperUser = mkOption { type = types.bool; default = false; - description = mdDoc '' + description = '' Whether to run the exporter as {option}`services.mysql.user`. ''; }; @@ -24,7 +24,7 @@ in { configFile = mkOption { type = types.path; example = "/var/lib/prometheus-mysqld-exporter.cnf"; - description = mdDoc '' + description = '' Path to the services config file. See <https://github.com/prometheus/mysqld_exporter#running> for more information about diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/nats.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/nats.nix new file mode 100644 index 000000000000..224ce474d537 --- /dev/null +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/nats.nix @@ -0,0 +1,31 @@ +{ config, lib, pkgs, options, ... }: + +let + cfg = config.services.prometheus.exporters.nats; + inherit (lib) mkOption types concatStringsSep; +in +{ + port = 7777; + + extraOpts = { + url = mkOption { + type = types.str; + default = "http://127.0.0.1:8222"; + description = '' + NATS monitor endpoint to query. + ''; + }; + }; + + serviceOpts = { + serviceConfig = { + ExecStart = '' + ${pkgs.prometheus-nats-exporter}/bin/prometheus-nats-exporter \ + -addr ${cfg.listenAddress} \ + -port ${toString cfg.port} \ + ${concatStringsSep " \\\n " cfg.extraFlags} \ + ${cfg.url} + ''; + }; + }; +} diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/nextcloud.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/nextcloud.nix index 82deea6864e8..d221bac8421a 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/nextcloud.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/nextcloud.nix @@ -1,9 +1,13 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.nextcloud; + inherit (lib) + mkOption + types + escapeShellArg + concatStringsSep + ; in { port = 9205; @@ -11,7 +15,7 @@ in url = mkOption { type = types.str; example = "https://domain.tld"; - description = lib.mdDoc '' + description = '' URL to the Nextcloud serverinfo page. Adding the path to the serverinfo API is optional, it defaults to `/ocs/v2.php/apps/serverinfo/api/v1/info`. @@ -20,7 +24,7 @@ in username = mkOption { type = types.str; default = "nextcloud-exporter"; - description = lib.mdDoc '' + description = '' Username for connecting to Nextcloud. Note that this account needs to have admin privileges in Nextcloud. Unused when using token authentication. @@ -30,7 +34,7 @@ in type = types.nullOr types.path; default = null; example = "/path/to/password-file"; - description = lib.mdDoc '' + description = '' File containing the password for connecting to Nextcloud. Make sure that this file is readable by the exporter user. ''; @@ -39,7 +43,7 @@ in type = types.nullOr types.path; default = null; example = "/path/to/token-file"; - description = lib.mdDoc '' + description = '' File containing the token for connecting to Nextcloud. Make sure that this file is readable by the exporter user. ''; @@ -47,7 +51,7 @@ in timeout = mkOption { type = types.str; default = "5s"; - description = lib.mdDoc '' + description = '' Timeout for getting server info document. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/nginx.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/nginx.nix index 339749226aa4..091ad2291d2a 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/nginx.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/nginx.nix @@ -1,9 +1,16 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.nginx; + inherit (lib) + mkOption + types + mkMerge + mkRemovedOptionModule + mkRenamedOptionModule + mkIf + concatStringsSep + ; in { port = 9113; @@ -11,7 +18,7 @@ in scrapeUri = mkOption { type = types.str; default = "http://localhost/nginx_status"; - description = lib.mdDoc '' + description = '' Address to access the nginx status page. Can be enabled with services.nginx.statusPage = true. ''; @@ -19,14 +26,14 @@ in telemetryPath = mkOption { type = types.str; default = "/metrics"; - description = lib.mdDoc '' + description = '' Path under which to expose metrics. ''; }; sslVerify = mkOption { type = types.bool; default = true; - description = lib.mdDoc '' + description = '' Whether to perform certificate verification for https. ''; }; @@ -37,7 +44,7 @@ in "label1=value1" "label2=value2" ]; - description = lib.mdDoc '' + description = '' A list of constant labels that will be used in every metric. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/nginxlog.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/nginxlog.nix index b79a034e1384..2b4fd12895a3 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/nginxlog.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/nginxlog.nix @@ -1,16 +1,15 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.nginxlog; + inherit (lib) mkOption types; in { port = 9117; extraOpts = { settings = mkOption { type = types.attrs; default = {}; - description = lib.mdDoc '' + description = '' All settings of nginxlog expressed as an Nix attrset. Check the official documentation for the corresponding YAML @@ -24,7 +23,7 @@ in { metricsEndpoint = mkOption { type = types.str; default = "/metrics"; - description = lib.mdDoc '' + description = '' Path under which to expose metrics. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/node.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/node.nix index 9b8a0d2c6bc2..9d6b51ad140d 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/node.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/node.nix @@ -1,9 +1,15 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.node; + inherit (lib) + mkOption + types + concatStringsSep + concatMapStringsSep + any + optionals + ; collectorIsEnabled = final: any (collector: (final == collector)) cfg.enabledCollectors; collectorIsDisabled = final: any (collector: (final == collector)) cfg.disabledCollectors; in @@ -14,7 +20,7 @@ in type = types.listOf types.str; default = []; example = [ "systemd" ]; - description = lib.mdDoc '' + description = '' Collectors to enable. The collectors listed here are enabled in addition to the default ones. ''; }; @@ -22,7 +28,7 @@ in type = types.listOf types.str; default = []; example = [ "timex" ]; - description = lib.mdDoc '' + description = '' Collectors to disable which are enabled by default. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/nut.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/nut.nix index a14e379079b0..157bdadddfc9 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/nut.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/nut.nix @@ -1,9 +1,13 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.nut; + inherit (lib) + mkOption + types + optionalString + concatStringsSep + ; in { port = 9199; @@ -11,7 +15,7 @@ in nutServer = mkOption { type = types.str; default = "127.0.0.1"; - description = lib.mdDoc '' + description = '' Hostname or address of the NUT server ''; }; @@ -19,7 +23,7 @@ in type = types.str; default = ""; example = "nut"; - description = lib.mdDoc '' + description = '' The user to log in into NUT server. If set, passwordPath should also be set. @@ -31,7 +35,7 @@ in type = types.nullOr types.path; default = null; apply = final: if final == null then null else toString final; - description = lib.mdDoc '' + description = '' A run-time path to the nutUser password file, which should be provisioned outside of Nix store. ''; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/openldap.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/openldap.nix index aee3ae5bb2d4..bb65bd270933 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/openldap.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/openldap.nix @@ -1,16 +1,15 @@ { config, lib, pkgs, ... }: -with lib; - let cfg = config.services.prometheus.exporters.openldap; + inherit (lib) mkOption types concatStringsSep; in { port = 9330; extraOpts = { ldapCredentialFile = mkOption { type = types.path; example = "/run/keys/ldap_pass"; - description = lib.mdDoc '' + description = '' Environment file to contain the credentials to authenticate against `openldap`. @@ -26,21 +25,21 @@ in { default = "tcp"; example = "udp"; type = types.str; - description = lib.mdDoc '' + description = '' Which protocol to use to connect against `openldap`. ''; }; ldapAddr = mkOption { default = "localhost:389"; type = types.str; - description = lib.mdDoc '' + description = '' Address of the `openldap`-instance. ''; }; metricsPath = mkOption { default = "/metrics"; type = types.str; - description = lib.mdDoc '' + description = '' URL path where metrics should be exposed. ''; }; @@ -48,7 +47,7 @@ in { default = "30s"; type = types.str; example = "1m"; - description = lib.mdDoc '' + description = '' Scrape interval of the exporter. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/pgbouncer.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/pgbouncer.nix index 9587403c7802..71b602638632 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/pgbouncer.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/pgbouncer.nix @@ -1,9 +1,14 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.pgbouncer; + inherit (lib) + mkOption + types + optionals + escapeShellArg + concatStringsSep + ; in { port = 9127; @@ -12,7 +17,7 @@ in telemetryPath = mkOption { type = types.str; default = "/metrics"; - description = lib.mdDoc '' + description = '' Path under which to expose metrics. ''; }; @@ -21,7 +26,7 @@ in type = types.str; default = ""; example = "postgres://admin:@localhost:6432/pgbouncer?sslmode=require"; - description = lib.mdDoc '' + description = '' Connection string for accessing pgBouncer. NOTE: You MUST keep pgbouncer as database name (special internal db)!!! @@ -38,7 +43,7 @@ in type = types.nullOr types.path; default = null; example = "/run/keys/pgBouncer-connection-string"; - description = lib.mdDoc '' + description = '' File that contains pgBouncer connection string in format: postgres://admin:@localhost:6432/pgbouncer?sslmode=require @@ -54,7 +59,7 @@ in pidFile = mkOption { type = types.nullOr types.str; default = null; - description = lib.mdDoc '' + description = '' Path to PgBouncer pid file. If provided, the standard process metrics get exported for the PgBouncer @@ -70,7 +75,7 @@ in webSystemdSocket = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Use systemd socket activation listeners instead of port listeners (Linux only). ''; }; @@ -78,7 +83,7 @@ in logLevel = mkOption { type = types.enum ["debug" "info" "warn" "error" ]; default = "info"; - description = lib.mdDoc '' + description = '' Only log messages with the given severity or above. ''; }; @@ -86,7 +91,7 @@ in logFormat = mkOption { type = types.enum ["logfmt" "json"]; default = "logfmt"; - description = lib.mdDoc '' + description = '' Output format of log messages. One of: [logfmt, json] ''; }; @@ -94,7 +99,7 @@ in webConfigFile = mkOption { type = types.nullOr types.path; default = null; - description = lib.mdDoc '' + description = '' Path to configuration file that can enable TLS or authentication. ''; }; @@ -102,7 +107,7 @@ in extraFlags = mkOption { type = types.listOf types.str; default = [ ]; - description = lib.mdDoc '' + description = '' Extra commandline options when launching Prometheus. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/php-fpm.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/php-fpm.nix index 4ea5f64012c0..5d8253f26c43 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/php-fpm.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/php-fpm.nix @@ -16,7 +16,7 @@ in { telemetryPath = lib.mkOption { type = lib.types.str; default = "/metrics"; - description = lib.mdDoc '' + description = '' Path under which to expose metrics. ''; }; @@ -25,7 +25,7 @@ in { type = lib.types.nullOr lib.types.path; default = null; example = "/root/prometheus-php-fpm-exporter.env"; - description = lib.mdDoc '' + description = '' Environment file as defined in {manpage}`systemd.exec(5)`. Secrets may be passed to the service without adding them to the diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/pihole.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/pihole.nix index 4b7eca7493a6..30b260dc3792 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/pihole.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/pihole.nix @@ -1,9 +1,13 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.pihole; + inherit (lib) + mkOption + types + mkRemovedOptionModule + optionalString + ; in { imports = [ @@ -17,7 +21,7 @@ in type = types.str; default = ""; example = "580a770cb40511eb85290242ac130003580a770cb40511eb85290242ac130003"; - description = lib.mdDoc '' + description = '' Pi-Hole API token which can be used instead of a password ''; }; @@ -25,7 +29,7 @@ in type = types.str; default = ""; example = "password"; - description = lib.mdDoc '' + description = '' The password to login into Pi-Hole. An api token can be used instead. ''; }; @@ -33,7 +37,7 @@ in type = types.str; default = "pihole"; example = "127.0.0.1"; - description = lib.mdDoc '' + description = '' Hostname or address where to find the Pi-Hole webinterface ''; }; @@ -41,7 +45,7 @@ in type = types.port; default = 80; example = 443; - description = lib.mdDoc '' + description = '' The port Pi-Hole webinterface is reachable on ''; }; @@ -49,14 +53,14 @@ in type = types.enum [ "http" "https" ]; default = "http"; example = "https"; - description = lib.mdDoc '' + description = '' The protocol which is used to connect to Pi-Hole ''; }; timeout = mkOption { type = types.str; default = "5s"; - description = lib.mdDoc '' + description = '' Controls the timeout to connect to a Pi-Hole instance ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/ping.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/ping.nix index bda5038a0c64..9122a6be66e6 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/ping.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/ping.nix @@ -1,9 +1,9 @@ { config, lib, pkgs, options, ... }: -with lib; let cfg = config.services.prometheus.exporters.ping; + inherit (lib) mkOption types concatStringsSep; settingsFormat = pkgs.formats.yaml {}; configFile = settingsFormat.generate "config.yml" cfg.settings; @@ -23,7 +23,7 @@ in type = settingsFormat.type; default = {}; - description = lib.mdDoc '' + description = '' Configuration for ping_exporter, see <https://github.com/czerwonk/ping_exporter> for supported values. diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/postfix.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/postfix.nix index ead8e806f85a..7aa3622f16d6 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/postfix.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/postfix.nix @@ -1,16 +1,22 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.postfix; + inherit (lib) + mkOption + types + mkIf + escapeShellArg + concatStringsSep + optional + ; in { port = 9154; extraOpts = { group = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Group under which the postfix exporter shall be run. It should match the group that is allowed to access the `showq` socket in the `queue/public/` directory. @@ -20,7 +26,7 @@ in telemetryPath = mkOption { type = types.str; default = "/metrics"; - description = lib.mdDoc '' + description = '' Path under which to expose metrics. ''; }; @@ -28,7 +34,7 @@ in type = types.path; default = "/var/log/postfix_exporter_input.log"; example = "/var/log/mail.log"; - description = lib.mdDoc '' + description = '' Path where Postfix writes log entries. This file will be truncated by this exporter! ''; @@ -37,7 +43,7 @@ in type = types.path; default = "/var/lib/postfix/queue/public/showq"; example = "/var/spool/postfix/public/showq"; - description = lib.mdDoc '' + description = '' Path where Postfix places its showq socket. ''; }; @@ -45,21 +51,21 @@ in enable = mkOption { type = types.bool; default = true; - description = lib.mdDoc '' + description = '' Whether to enable reading metrics from the systemd journal instead of from a logfile ''; }; unit = mkOption { type = types.str; default = "postfix.service"; - description = lib.mdDoc '' + description = '' Name of the postfix systemd unit. ''; }; slice = mkOption { type = types.nullOr types.str; default = null; - description = lib.mdDoc '' + description = '' Name of the postfix systemd slice. This overrides the {option}`systemd.unit`. ''; @@ -67,7 +73,7 @@ in journalPath = mkOption { type = types.nullOr types.path; default = null; - description = lib.mdDoc '' + description = '' Path to the systemd journal. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/postgres.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/postgres.nix index 514b2d0c8f2d..bf392382660a 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/postgres.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/postgres.nix @@ -1,9 +1,14 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.postgres; + inherit (lib) + mkOption + types + mkIf + mkForce + concatStringsSep + ; in { port = 9187; @@ -11,7 +16,7 @@ in telemetryPath = mkOption { type = types.str; default = "/metrics"; - description = lib.mdDoc '' + description = '' Path under which to expose metrics. ''; }; @@ -19,14 +24,14 @@ in type = types.str; default = "user=postgres database=postgres host=/run/postgresql sslmode=disable"; example = "postgresql://username:password@localhost:5432/postgres?sslmode=disable"; - description = lib.mdDoc '' + description = '' Accepts PostgreSQL URI form and key=value form arguments. ''; }; runAsLocalSuperUser = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Whether to run the exporter as the local 'postgres' super user. ''; }; @@ -36,7 +41,7 @@ in type = types.nullOr types.path; default = null; example = "/root/prometheus-postgres-exporter.env"; - description = lib.mdDoc '' + description = '' Environment file as defined in {manpage}`systemd.exec(5)`. Secrets may be passed to the service without adding them to the diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/process.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/process.nix index 86c71a88e28b..8e5eceee067c 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/process.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/process.nix @@ -1,9 +1,13 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.process; + inherit (lib) + mkOption + types + literalExpression + concatStringsSep + ; configFile = pkgs.writeText "process-exporter.yaml" (builtins.toJSON cfg.settings); in { @@ -18,7 +22,7 @@ in { name = "{{.Matches.Wrapped}} {{ .Matches.Args }}"; cmdline = [ "^/nix/store[^ ]*/(?P<Wrapped>[^ /]*) (?P<Args>.*)" ]; } ] ''; - description = lib.mdDoc '' + description = '' All settings expressed as an Nix attrset. Check the official documentation for the corresponding YAML diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/pve.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/pve.nix index 96db49d9591f..8928577b6953 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/pve.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/pve.nix @@ -1,8 +1,14 @@ { config, lib, pkgs, options, ... }: -with lib; let cfg = config.services.prometheus.exporters.pve; + inherit (lib) + mkOption + types + mkPackageOption + optionalString + optionalAttrs + ; # pve exporter requires a config file so create an empty one if configFile is not provided emptyConfigFile = pkgs.writeTextFile { diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/py-air-control.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/py-air-control.nix index 60243e0ed069..d788ce363d61 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/py-air-control.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/py-air-control.nix @@ -1,9 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.py-air-control; + inherit (lib) mkOption types; workingDir = "/var/lib/${cfg.stateDir}"; @@ -14,14 +13,14 @@ in deviceHostname = mkOption { type = types.str; example = "192.168.1.123"; - description = lib.mdDoc '' + description = '' The hostname of the air purification device from which to scrape the metrics. ''; }; protocol = mkOption { type = types.str; default = "http"; - description = lib.mdDoc '' + description = '' The protocol to use when communicating with the air purification device. Available: [http, coap, plain_coap] ''; @@ -29,7 +28,7 @@ in stateDir = mkOption { type = types.str; default = "prometheus-py-air-control-exporter"; - description = lib.mdDoc '' + description = '' Directory below `/var/lib` to store runtime data. This directory will be created automatically using systemd's StateDirectory mechanism. ''; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/redis.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/redis.nix index 71f94a700efd..672e3dfe7b05 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/redis.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/redis.nix @@ -1,14 +1,14 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.redis; + inherit (lib) concatStringsSep; in { port = 9121; serviceOpts = { serviceConfig = { + RestrictAddressFamilies = [ "AF_UNIX" ]; ExecStart = '' ${pkgs.prometheus-redis-exporter}/bin/redis_exporter \ -web.listen-address ${cfg.listenAddress}:${toString cfg.port} \ diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/restic.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/restic.nix index 12962af5f111..ef44803ba053 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/restic.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/restic.nix @@ -1,16 +1,25 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.restic; + inherit (lib) + mkOption + types + concatStringsSep + mkIf + mapAttrs' + splitString + toUpper + optionalAttrs + nameValuePair + ; in { port = 9753; extraOpts = { repository = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' URI pointing to the repository to monitor. ''; example = "sftp:backup@192.168.1.100:/backups/example"; @@ -18,7 +27,7 @@ in passwordFile = mkOption { type = types.path; - description = lib.mdDoc '' + description = '' File containing the password to the repository. ''; example = "/etc/nixos/restic-password"; @@ -27,7 +36,7 @@ in environmentFile = mkOption { type = with types; nullOr path; default = null; - description = lib.mdDoc '' + description = '' File containing the credentials to access the repository, in the format of an EnvironmentFile as described by systemd.exec(5) ''; @@ -36,7 +45,7 @@ in refreshInterval = mkOption { type = types.ints.unsigned; default = 60; - description = lib.mdDoc '' + description = '' Refresh interval for the metrics in seconds. Computing the metrics is an expensive task, keep this value as high as possible. ''; @@ -45,7 +54,7 @@ in rcloneOptions = mkOption { type = with types; attrsOf (oneOf [ str bool ]); default = { }; - description = lib.mdDoc '' + description = '' Options to pass to rclone to control its behavior. See <https://rclone.org/docs/#options> for available options. When specifying option names, strip the @@ -58,7 +67,7 @@ in rcloneConfig = mkOption { type = with types; attrsOf (oneOf [ str bool ]); default = { }; - description = lib.mdDoc '' + description = '' Configuration for the rclone remote being used for backup. See the remote's specific options under rclone's docs at <https://rclone.org/docs/>. When specifying @@ -79,7 +88,7 @@ in rcloneConfigFile = mkOption { type = with types; nullOr path; default = null; - description = lib.mdDoc '' + description = '' Path to the file containing rclone configuration. This file must contain configuration for the remote specified in this backup set and also must be readable by root. diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/rspamd.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/rspamd.nix index 8169d4075a9f..8993aee5d248 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/rspamd.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/rspamd.nix @@ -1,9 +1,16 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.rspamd; + inherit (lib) + mkOption + types + replaceStrings + mkRemovedOptionModule + recursiveUpdate + concatStringsSep + literalExpression + ; mkFile = conf: pkgs.writeText "rspamd-exporter-config.yml" (builtins.toJSON conf); @@ -69,7 +76,7 @@ in custom_label = "some_value"; } ''; - description = lib.mdDoc "Set of labels added to each metric."; + description = "Set of labels added to each metric."; }; }; serviceOpts.serviceConfig.ExecStart = '' diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/rtl_433.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/rtl_433.nix index 42b659501161..02624a0e80e7 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/rtl_433.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/rtl_433.nix @@ -12,15 +12,15 @@ in options = { name = lib.mkOption { type = str; - description = lib.mdDoc "Name to match."; + description = "Name to match."; }; "${field}" = lib.mkOption { type = int; - description = lib.mdDoc description; + description = description; }; location = lib.mkOption { type = str; - description = lib.mdDoc "Location to match."; + description = "Location to match."; }; }; }); @@ -30,7 +30,7 @@ in type = lib.types.str; default = "-C si"; example = "-C si -R 19"; - description = lib.mdDoc '' + description = '' Flags passed verbatim to rtl_433 binary. Having `-C si` (the default) is recommended since only Celsius temperatures are parsed. ''; @@ -41,7 +41,7 @@ in example = [ { name = "Acurite"; channel = 6543; location = "Kitchen"; } ]; - description = lib.mdDoc '' + description = '' List of channel matchers to export. ''; }; @@ -51,7 +51,7 @@ in example = [ { name = "Nexus"; id = 1; location = "Bedroom"; } ]; - description = lib.mdDoc '' + description = '' List of ID matchers to export. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/scaphandre.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/scaphandre.nix index d4c929d88b9c..fbee2850db74 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/scaphandre.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/scaphandre.nix @@ -14,7 +14,7 @@ in { telemetryPath = lib.mkOption { type = lib.types.str; default = "/metrics"; - description = lib.mdDoc '' + description = '' Path under which to expose metrics. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/script.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/script.nix index f37fa456d27c..0967ce236a62 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/script.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/script.nix @@ -1,9 +1,13 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.script; + inherit (lib) + mkOption + types + literalExpression + concatStringsSep + ; configFile = pkgs.writeText "script-exporter.yaml" (builtins.toJSON cfg.settings); in { @@ -15,18 +19,18 @@ in name = mkOption { type = str; example = "sleep"; - description = lib.mdDoc "Name of the script."; + description = "Name of the script."; }; script = mkOption { type = str; example = "sleep 5"; - description = lib.mdDoc "Shell script to execute when metrics are requested."; + description = "Shell script to execute when metrics are requested."; }; timeout = mkOption { type = nullOr int; default = null; example = 60; - description = lib.mdDoc "Optional timeout for the script in seconds."; + description = "Optional timeout for the script in seconds."; }; }; }); @@ -37,7 +41,7 @@ in ]; } ''; - description = lib.mdDoc '' + description = '' All settings expressed as an Nix attrset. Check the official documentation for the corresponding YAML diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/shelly.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/shelly.nix index 1d2329dfbae1..be3e483c6ee1 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/shelly.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/shelly.nix @@ -1,16 +1,15 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.shelly; + inherit (lib) mkOption types; in { port = 9784; extraOpts = { metrics-file = mkOption { type = types.path; - description = lib.mdDoc '' + description = '' Path to the JSON file with the metric definitions ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/smartctl.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/smartctl.nix index 1040e9ecadbd..8aadd87abbed 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/smartctl.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/smartctl.nix @@ -1,9 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.smartctl; + inherit (lib) mkOption types literalExpression; args = lib.escapeShellArgs ([ "--web.listen-address=${cfg.listenAddress}:${toString cfg.port}" "--smartctl.path=${pkgs.smartmontools}/bin/smartctl" @@ -20,7 +19,7 @@ in { example = literalExpression '' [ "/dev/sda", "/dev/nvme0n1" ]; ''; - description = lib.mdDoc '' + description = '' Paths to the disks that will be monitored. Will autodiscover all disks if none given. ''; @@ -29,7 +28,7 @@ in { type = types.str; default = "60s"; example = "2m"; - description = lib.mdDoc '' + description = '' Interval that limits how often a disk can be queried. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/smokeping.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/smokeping.nix index 2bacc9cd7cac..c3baed150376 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/smokeping.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/smokeping.nix @@ -1,9 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.smokeping; + inherit (lib) mkOption types concatStringsSep; goDuration = types.mkOptionType { name = "goDuration"; description = "Go duration (https://golang.org/pkg/time/#ParseDuration)"; @@ -17,27 +16,27 @@ in telemetryPath = mkOption { type = types.str; default = "/metrics"; - description = lib.mdDoc '' + description = '' Path under which to expose metrics. ''; }; pingInterval = mkOption { type = goDuration; default = "1s"; - description = lib.mdDoc '' + description = '' Interval between pings. ''; }; buckets = mkOption { type = types.commas; default = "5e-05,0.0001,0.0002,0.0004,0.0008,0.0016,0.0032,0.0064,0.0128,0.0256,0.0512,0.1024,0.2048,0.4096,0.8192,1.6384,3.2768,6.5536,13.1072,26.2144"; - description = lib.mdDoc '' + description = '' List of buckets to use for the response duration histogram. ''; }; hosts = mkOption { type = with types; listOf str; - description = lib.mdDoc '' + description = '' List of endpoints to probe. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/snmp.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/snmp.nix index 207446e39f49..dc10a9a2f92e 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/snmp.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/snmp.nix @@ -1,10 +1,15 @@ { config, lib, pkgs, options, ... }: -with lib; - let logPrefix = "services.prometheus.exporters.snmp"; cfg = config.services.prometheus.exporters.snmp; + inherit (lib) + mkOption + types + literalExpression + escapeShellArg + concatStringsSep + ; # This ensures that we can deal with string paths, path types and # store-path strings with context. @@ -31,7 +36,7 @@ in configurationPath = mkOption { type = types.nullOr types.path; default = null; - description = lib.mdDoc '' + description = '' Path to a snmp exporter configuration file. Mutually exclusive with 'configuration' option. ''; example = literalExpression "./snmp.yml"; @@ -40,7 +45,7 @@ in configuration = mkOption { type = types.nullOr types.attrs; default = null; - description = lib.mdDoc '' + description = '' Snmp exporter configuration as nix attribute set. Mutually exclusive with 'configurationPath' option. ''; example = { @@ -54,7 +59,7 @@ in enableConfigCheck = mkOption { type = types.bool; default = true; - description = lib.mdDoc '' + description = '' Whether to run a correctness check for the configuration file. This depends on the configuration file residing in the nix-store. Paths passed as string will be copied to the store. @@ -64,7 +69,7 @@ in logFormat = mkOption { type = types.enum ["logfmt" "json"]; default = "logfmt"; - description = lib.mdDoc '' + description = '' Output format of log messages. ''; }; @@ -72,7 +77,7 @@ in logLevel = mkOption { type = types.enum ["debug" "info" "warn" "error"]; default = "info"; - description = lib.mdDoc '' + description = '' Only log messages with the given severity or above. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/sql.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/sql.nix index dbfa69678a0c..59715f5d33e2 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/sql.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/sql.nix @@ -1,13 +1,19 @@ { config, lib, pkgs, options, ... }: -with lib; let cfg = config.services.prometheus.exporters.sql; + inherit (lib) + mkOption + types + mapAttrs + mapAttrsToList + concatStringsSep + ; cfgOptions = { options = with types; { jobs = mkOption { type = attrsOf (submodule jobOptions); default = { }; - description = lib.mdDoc "An attrset of metrics scraping jobs to run."; + description = "An attrset of metrics scraping jobs to run."; }; }; }; @@ -15,23 +21,23 @@ let options = with types; { interval = mkOption { type = str; - description = lib.mdDoc '' + description = '' How often to run this job, specified in [Go duration](https://golang.org/pkg/time/#ParseDuration) format. ''; }; connections = mkOption { type = listOf str; - description = lib.mdDoc "A list of connection strings of the SQL servers to scrape metrics from"; + description = "A list of connection strings of the SQL servers to scrape metrics from"; }; startupSql = mkOption { type = listOf str; default = []; - description = lib.mdDoc "A list of SQL statements to execute once after making a connection."; + description = "A list of SQL statements to execute once after making a connection."; }; queries = mkOption { type = attrsOf (submodule queryOptions); - description = lib.mdDoc "SQL queries to run."; + description = "SQL queries to run."; }; }; }; @@ -40,20 +46,20 @@ let help = mkOption { type = nullOr str; default = null; - description = lib.mdDoc "A human-readable description of this metric."; + description = "A human-readable description of this metric."; }; labels = mkOption { type = listOf str; default = [ ]; - description = lib.mdDoc "A set of columns that will be used as Prometheus labels."; + description = "A set of columns that will be used as Prometheus labels."; }; query = mkOption { type = str; - description = lib.mdDoc "The SQL query to run."; + description = "The SQL query to run."; }; values = mkOption { type = listOf str; - description = lib.mdDoc "A set of columns that will be used as values of this metric."; + description = "A set of columns that will be used as values of this metric."; }; }; }; @@ -77,14 +83,14 @@ in configFile = mkOption { type = with types; nullOr path; default = null; - description = lib.mdDoc '' + description = '' Path to configuration file. ''; }; configuration = mkOption { type = with types; nullOr (submodule cfgOptions); default = null; - description = lib.mdDoc '' + description = '' Exporter configuration as nix attribute set. Mutually exclusive with 'configFile' option. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/statsd.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/statsd.nix index 94df86167e8c..b1bc65c9a492 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/statsd.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/statsd.nix @@ -1,9 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.statsd; + inherit (lib) concatStringsSep; in { port = 9102; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/surfboard.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/surfboard.nix index 337ebd4ed66f..d848e263a3b6 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/surfboard.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/surfboard.nix @@ -1,9 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.surfboard; + inherit (lib) mkOption types concatStringsSep; in { port = 9239; @@ -11,7 +10,7 @@ in modemAddress = mkOption { type = types.str; default = "192.168.100.1"; - description = lib.mdDoc '' + description = '' The hostname or IP of the cable modem. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/systemd.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/systemd.nix index 2edd1de83e1b..52bad81ed7d5 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/systemd.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/systemd.nix @@ -1,9 +1,8 @@ { config, pkgs, lib, ... }: -with lib; - -let cfg = config.services.prometheus.exporters.systemd; - +let + cfg = config.services.prometheus.exporters.systemd; + inherit (lib) concatStringsSep; in { port = 9558; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/tor.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/tor.nix index b91f69aded3d..d39112d0c283 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/tor.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/tor.nix @@ -1,9 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.tor; + inherit (lib) mkOption types concatStringsSep; in { port = 9130; @@ -11,7 +10,7 @@ in torControlAddress = mkOption { type = types.str; default = "127.0.0.1"; - description = lib.mdDoc '' + description = '' Tor control IP address or hostname. ''; }; @@ -19,7 +18,7 @@ in torControlPort = mkOption { type = types.port; default = 9051; - description = lib.mdDoc '' + description = '' Tor control port. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/unbound.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/unbound.nix index 2f4444a96c69..df6011e2434b 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/unbound.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/unbound.nix @@ -5,10 +5,17 @@ , ... }: -with lib; - let cfg = config.services.prometheus.exporters.unbound; + inherit (lib) + mkOption + types + mkRemovedOptionModule + optionalAttrs + optionalString + mkMerge + mkIf + ; in { imports = [ @@ -22,7 +29,7 @@ in telemetryPath = mkOption { type = types.str; default = "/metrics"; - description = lib.mdDoc '' + description = '' Path under which to expose metrics. ''; }; @@ -59,7 +66,7 @@ in type = types.str; default = "tcp://127.0.0.1:8953"; example = "unix:///run/unbound/unbound.socket"; - description = lib.mdDoc '' + description = '' Path to the unbound control socket. Supports unix domain sockets, as well as the TCP interface. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/unifi.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/unifi.nix index b7addcd56827..07d177251f40 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/unifi.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/unifi.nix @@ -1,9 +1,14 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.unifi; + inherit (lib) + mkOption + types + escapeShellArg + optionalString + concatStringsSep + ; in { port = 9130; @@ -11,7 +16,7 @@ in unifiAddress = mkOption { type = types.str; example = "https://10.0.0.1:8443"; - description = lib.mdDoc '' + description = '' URL of the UniFi Controller API. ''; }; @@ -19,7 +24,7 @@ in unifiInsecure = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' If enabled skip the verification of the TLS certificate of the UniFi Controller API. Use with caution. ''; @@ -28,14 +33,14 @@ in unifiUsername = mkOption { type = types.str; example = "ReadOnlyUser"; - description = lib.mdDoc '' + description = '' username for authentication against UniFi Controller API. ''; }; unifiPassword = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Password for authentication against UniFi Controller API. ''; }; @@ -44,7 +49,7 @@ in type = types.str; default = "5s"; example = "2m"; - description = lib.mdDoc '' + description = '' Timeout including unit for UniFi Controller API requests. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/unpoller.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/unpoller.nix index aff1197a8775..7b9ba4c5d1ed 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/unpoller.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/unpoller.nix @@ -1,9 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.unpoller; + inherit (lib) mkEnableOption generators; configFile = pkgs.writeText "prometheus-unpoller-exporter.json" (generators.toJSON {} { poller = { inherit (cfg.log) debug quiet; }; @@ -24,9 +23,9 @@ in { inherit (options.services.unpoller.unifi) controllers; inherit (options.services.unpoller) loki; log = { - debug = mkEnableOption (lib.mdDoc "debug logging including line numbers, high resolution timestamps, per-device logs"); - quiet = mkEnableOption (lib.mdDoc "startup and error logs only"); - prometheusErrors = mkEnableOption (lib.mdDoc "emitting errors to prometheus"); + debug = mkEnableOption "debug logging including line numbers, high resolution timestamps, per-device logs"; + quiet = mkEnableOption "startup and error logs only"; + prometheusErrors = mkEnableOption "emitting errors to prometheus"; }; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/v2ray.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/v2ray.nix index 7b21e5fc7cb7..4fda15c9ee4e 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/v2ray.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/v2ray.nix @@ -1,9 +1,8 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.v2ray; + inherit (lib) mkOption types concatStringsSep; in { port = 9299; @@ -11,7 +10,7 @@ in v2rayEndpoint = mkOption { type = types.str; default = "127.0.0.1:54321"; - description = lib.mdDoc '' + description = '' v2ray grpc api endpoint ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/varnish.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/varnish.nix index 98fbba82c8e9..e94c513ae84f 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/varnish.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/varnish.nix @@ -1,9 +1,15 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.varnish; + inherit (lib) + mkOption + types + mkDefault + optional + escapeShellArg + concatStringsSep + ; in { port = 9131; @@ -11,35 +17,35 @@ in noExit = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Do not exit server on Varnish scrape errors. ''; }; withGoMetrics = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Export go runtime and http handler metrics. ''; }; verbose = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Enable verbose logging. ''; }; raw = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Enable raw stdout logging without timestamps. ''; }; varnishStatPath = mkOption { type = types.str; default = "varnishstat"; - description = lib.mdDoc '' + description = '' Path to varnishstat. ''; }; @@ -47,21 +53,21 @@ in type = types.nullOr types.str; default = config.services.varnish.stateDir; defaultText = lib.literalExpression "config.services.varnish.stateDir"; - description = lib.mdDoc '' + description = '' varnishstat -n value. ''; }; healthPath = mkOption { type = types.nullOr types.str; default = null; - description = lib.mdDoc '' + description = '' Path under which to expose healthcheck. Disabled unless configured. ''; }; telemetryPath = mkOption { type = types.str; default = "/metrics"; - description = lib.mdDoc '' + description = '' Path under which to expose metrics. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/wireguard.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/wireguard.nix index 127c8021a9f0..7a48c836425f 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/wireguard.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/wireguard.nix @@ -1,9 +1,15 @@ { config, lib, pkgs, options, ... }: -with lib; - let cfg = config.services.prometheus.exporters.wireguard; + inherit (lib) + mkOption + types + mkRenamedOptionModule + mkEnableOption + optionalString + escapeShellArg + ; in { port = 9586; imports = [ @@ -11,13 +17,13 @@ in { ({ options.warnings = options.warnings; options.assertions = options.assertions; }) ]; extraOpts = { - verbose = mkEnableOption (lib.mdDoc "verbose logging mode for prometheus-wireguard-exporter"); + verbose = mkEnableOption "verbose logging mode for prometheus-wireguard-exporter"; wireguardConfig = mkOption { type = with types; nullOr (either path str); default = null; - description = lib.mdDoc '' + description = '' Path to the Wireguard Config to [add the peer's name to the stats of a peer](https://github.com/MindFlavor/prometheus_wireguard_exporter/tree/2.0.0#usage). @@ -31,7 +37,7 @@ in { singleSubnetPerField = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' By default, all allowed IPs and subnets are comma-separated in the `allowed_ips` field. With this option enabled, a single IP and subnet will be listed in fields like `allowed_ip_0`, @@ -42,7 +48,7 @@ in { withRemoteIp = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Whether or not the remote IP of a WireGuard peer should be exposed via prometheus. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/zfs.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/zfs.nix index 21f6354cc4a2..a685b94b827f 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/zfs.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/zfs.nix @@ -1,9 +1,14 @@ { config, lib, pkgs, options, ... }: -with lib; let cfg = config.services.prometheus.exporters.zfs; + inherit (lib) + mkOption + types + concatStringsSep + concatMapStringsSep + ; in { port = 9134; @@ -12,7 +17,7 @@ in telemetryPath = mkOption { type = types.str; default = "/metrics"; - description = lib.mdDoc '' + description = '' Path under which to expose metrics. ''; }; @@ -20,7 +25,7 @@ in pools = mkOption { type = with types; nullOr (listOf str); default = [ ]; - description = lib.mdDoc '' + description = '' Name of the pool(s) to collect, repeat for multiple pools (default: all pools). ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/pushgateway.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/pushgateway.nix index e93924e4fba8..80e2339f5925 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/pushgateway.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/pushgateway.nix @@ -21,14 +21,14 @@ let in { options = { services.prometheus.pushgateway = { - enable = mkEnableOption (lib.mdDoc "Prometheus Pushgateway"); + enable = mkEnableOption "Prometheus Pushgateway"; package = mkPackageOption pkgs "prometheus-pushgateway" { }; web.listen-address = mkOption { type = types.nullOr types.str; default = null; - description = lib.mdDoc '' + description = '' Address to listen on for the web interface, API and telemetry. `null` will default to `:9091`. @@ -38,7 +38,7 @@ in { web.telemetry-path = mkOption { type = types.nullOr types.str; default = null; - description = lib.mdDoc '' + description = '' Path under which to expose metrics. `null` will default to `/metrics`. @@ -48,7 +48,7 @@ in { web.external-url = mkOption { type = types.nullOr types.str; default = null; - description = lib.mdDoc '' + description = '' The URL under which Pushgateway is externally reachable. ''; }; @@ -56,7 +56,7 @@ in { web.route-prefix = mkOption { type = types.nullOr types.str; default = null; - description = lib.mdDoc '' + description = '' Prefix for the internal routes of web endpoints. Defaults to the path of @@ -68,7 +68,7 @@ in { type = types.nullOr types.str; default = null; example = "10m"; - description = lib.mdDoc '' + description = '' The minimum interval at which to write out the persistence file. `null` will default to `5m`. @@ -78,7 +78,7 @@ in { log.level = mkOption { type = types.nullOr (types.enum ["debug" "info" "warn" "error" "fatal"]); default = null; - description = lib.mdDoc '' + description = '' Only log messages with the given severity or above. `null` will default to `info`. @@ -89,7 +89,7 @@ in { type = types.nullOr types.str; default = null; example = "logger:syslog?appname=bob&local=7"; - description = lib.mdDoc '' + description = '' Set the log target and format. `null` will default to `logger:stderr`. @@ -99,7 +99,7 @@ in { extraFlags = mkOption { type = types.listOf types.str; default = []; - description = lib.mdDoc '' + description = '' Extra commandline options when launching the Pushgateway. ''; }; @@ -107,7 +107,7 @@ in { persistMetrics = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Whether to persist metrics to a file. When enabled metrics will be saved to a file called @@ -121,7 +121,7 @@ in { stateDir = mkOption { type = types.str; default = "pushgateway"; - description = lib.mdDoc '' + description = '' Directory below `/var/lib` to store metrics. This directory will be created automatically using systemd's diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/sachet.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/sachet.nix index c908d599bd4e..3deb29aeb222 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/sachet.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/sachet.nix @@ -9,7 +9,7 @@ in { options = { services.prometheus.sachet = { - enable = mkEnableOption (lib.mdDoc "Sachet, an SMS alerting tool for the Prometheus Alertmanager"); + enable = mkEnableOption "Sachet, an SMS alerting tool for the Prometheus Alertmanager"; configuration = mkOption { type = types.nullOr types.attrs; @@ -32,7 +32,7 @@ in }]; } ''; - description = lib.mdDoc '' + description = '' Sachet's configuration as a nix attribute set. ''; }; @@ -40,7 +40,7 @@ in address = mkOption { type = types.str; default = "localhost"; - description = lib.mdDoc '' + description = '' The address Sachet will listen to. ''; }; @@ -48,7 +48,7 @@ in port = mkOption { type = types.port; default = 9876; - description = lib.mdDoc '' + description = '' The port Sachet will listen to. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/xmpp-alerts.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/xmpp-alerts.nix index 4545ca37d278..f3f553cd8642 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/xmpp-alerts.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/xmpp-alerts.nix @@ -15,13 +15,13 @@ in ]; options.services.prometheus.xmpp-alerts = { - enable = mkEnableOption (lib.mdDoc "XMPP Web hook service for Alertmanager"); + enable = mkEnableOption "XMPP Web hook service for Alertmanager"; settings = mkOption { type = settingsFormat.type; default = {}; - description = lib.mdDoc '' + description = '' Configuration for prometheus xmpp-alerts, see <https://github.com/jelmer/prometheus-xmpp-alerts/blob/master/xmpp-alerts.yml.example> for supported values. diff --git a/nixpkgs/nixos/modules/services/monitoring/riemann-dash.nix b/nixpkgs/nixos/modules/services/monitoring/riemann-dash.nix index 1622d7a9b920..243d0edb3aae 100644 --- a/nixpkgs/nixos/modules/services/monitoring/riemann-dash.nix +++ b/nixpkgs/nixos/modules/services/monitoring/riemann-dash.nix @@ -26,20 +26,20 @@ in { enable = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Enable the riemann-dash dashboard daemon. ''; }; config = mkOption { type = types.lines; - description = lib.mdDoc '' + description = '' Contents added to the end of the riemann-dash configuration file. ''; }; dataDir = mkOption { type = types.str; default = "/var/riemann-dash"; - description = lib.mdDoc '' + description = '' Location of the riemann-base dir. The dashboard configuration file is is stored to this directory. The directory is created automatically on service start, and owner is set to the riemanndash user. diff --git a/nixpkgs/nixos/modules/services/monitoring/riemann-tools.nix b/nixpkgs/nixos/modules/services/monitoring/riemann-tools.nix index 28821267b4f3..86a11694e7b4 100644 --- a/nixpkgs/nixos/modules/services/monitoring/riemann-tools.nix +++ b/nixpkgs/nixos/modules/services/monitoring/riemann-tools.nix @@ -23,21 +23,21 @@ in { enableHealth = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Enable the riemann-health daemon. ''; }; riemannHost = mkOption { type = types.str; default = "127.0.0.1"; - description = lib.mdDoc '' + description = '' Address of the host riemann node. Defaults to localhost. ''; }; extraArgs = mkOption { type = types.listOf types.str; default = []; - description = lib.mdDoc '' + description = '' A list of commandline-switches forwarded to a riemann-tool. See for example `riemann-health --help` for available options. ''; diff --git a/nixpkgs/nixos/modules/services/monitoring/riemann.nix b/nixpkgs/nixos/modules/services/monitoring/riemann.nix index 7ab8af85ed79..fd625e34e013 100644 --- a/nixpkgs/nixos/modules/services/monitoring/riemann.nix +++ b/nixpkgs/nixos/modules/services/monitoring/riemann.nix @@ -27,11 +27,11 @@ in { options = { services.riemann = { - enable = mkEnableOption (lib.mdDoc "Riemann network monitoring daemon"); + enable = mkEnableOption "Riemann network monitoring daemon"; config = mkOption { type = types.lines; - description = lib.mdDoc '' + description = '' Contents of the Riemann configuration file. For more complicated config you should use configFile. ''; @@ -39,7 +39,7 @@ in { configFiles = mkOption { type = with types; listOf path; default = []; - description = lib.mdDoc '' + description = '' Extra files containing Riemann configuration. These files will be loaded at runtime by Riemann (with Clojure's `load-file` function) at the end of the @@ -49,7 +49,7 @@ in { }; configFile = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' A Riemann config file. Any files in the same directory as this file will be added to the classpath by Riemann. ''; @@ -57,14 +57,14 @@ in { extraClasspathEntries = mkOption { type = with types; listOf str; default = []; - description = lib.mdDoc '' + description = '' Extra entries added to the Java classpath when running Riemann. ''; }; extraJavaOpts = mkOption { type = with types; listOf str; default = []; - description = lib.mdDoc '' + description = '' Extra Java options used when launching Riemann. ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/rustdesk-server.nix b/nixpkgs/nixos/modules/services/monitoring/rustdesk-server.nix index fcfd57167dd8..21e6128c7226 100644 --- a/nixpkgs/nixos/modules/services/monitoring/rustdesk-server.nix +++ b/nixpkgs/nixos/modules/services/monitoring/rustdesk-server.nix @@ -53,15 +53,14 @@ in { Slice = "system-rustdesk.slice"; User = "rustdesk"; Group = "rustdesk"; + DynamicUser = "yes"; Environment = []; WorkingDirectory = "/var/lib/rustdesk"; StateDirectory = "rustdesk"; StateDirectoryMode = "0750"; LockPersonality = true; - NoNewPrivileges = true; PrivateDevices = true; PrivateMounts = true; - PrivateTmp = true; PrivateUsers = true; ProtectClock = true; ProtectControlGroups = true; @@ -71,10 +70,7 @@ in { ProtectKernelModules = true; ProtectKernelTunables = true; ProtectProc = "invisible"; - ProtectSystem = "strict"; - RemoveIPC = true; RestrictNamespaces = true; - RestrictSUIDSGID = true; }; }; in lib.mkIf cfg.enable { diff --git a/nixpkgs/nixos/modules/services/monitoring/scollector.nix b/nixpkgs/nixos/modules/services/monitoring/scollector.nix index 0011d56a066a..49c3788e086f 100644 --- a/nixpkgs/nixos/modules/services/monitoring/scollector.nix +++ b/nixpkgs/nixos/modules/services/monitoring/scollector.nix @@ -35,7 +35,7 @@ in { enable = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Whether to run scollector. ''; }; @@ -45,7 +45,7 @@ in { user = mkOption { type = types.str; default = "scollector"; - description = lib.mdDoc '' + description = '' User account under which scollector runs. ''; }; @@ -53,7 +53,7 @@ in { group = mkOption { type = types.str; default = "scollector"; - description = lib.mdDoc '' + description = '' Group account under which scollector runs. ''; }; @@ -61,7 +61,7 @@ in { bosunHost = mkOption { type = types.str; default = "localhost:8070"; - description = lib.mdDoc '' + description = '' Host and port of the bosun server that will store the collected data. ''; @@ -71,7 +71,7 @@ in { type = with types; attrsOf (listOf path); default = {}; example = literalExpression ''{ "0" = [ "''${postgresStats}/bin/collect-stats" ]; }''; - description = lib.mdDoc '' + description = '' An attribute set mapping the frequency of collection to a list of binaries that should be executed at that frequency. You can use "0" to run a binary forever. @@ -82,7 +82,7 @@ in { type = with types; listOf str; default = []; example = [ "-d" ]; - description = lib.mdDoc '' + description = '' Extra scollector command line options ''; }; @@ -90,7 +90,7 @@ in { extraConfig = mkOption { type = types.lines; default = ""; - description = lib.mdDoc '' + description = '' Extra scollector configuration added to the end of scollector.toml ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/smartd.nix b/nixpkgs/nixos/modules/services/monitoring/smartd.nix index 8b79ac0e0c1e..2c05eaad25ac 100644 --- a/nixpkgs/nixos/modules/services/monitoring/smartd.nix +++ b/nixpkgs/nixos/modules/services/monitoring/smartd.nix @@ -71,14 +71,14 @@ let device = mkOption { example = "/dev/sda"; type = types.str; - description = lib.mdDoc "Location of the device."; + description = "Location of the device."; }; options = mkOption { default = ""; example = "-d sat"; type = types.separatedString " "; - description = lib.mdDoc "Options that determine how smartd monitors the device."; + description = "Options that determine how smartd monitors the device."; }; }; @@ -94,12 +94,12 @@ in services.smartd = { - enable = mkEnableOption (lib.mdDoc "smartd daemon from `smartmontools` package"); + enable = mkEnableOption "smartd daemon from `smartmontools` package"; autodetect = mkOption { default = true; type = types.bool; - description = lib.mdDoc '' + description = '' Whenever smartd should monitor all devices connected to the machine at the time it's being started (the default). @@ -112,7 +112,7 @@ in default = []; type = types.listOf types.str; example = ["-A /var/log/smartd/" "--interval=3600"]; - description = lib.mdDoc '' + description = '' Extra command-line options passed to the `smartd` daemon on startup. @@ -127,14 +127,14 @@ in default = config.services.mail.sendmailSetuidWrapper != null; defaultText = literalExpression "config.services.mail.sendmailSetuidWrapper != null"; type = types.bool; - description = lib.mdDoc "Whenever to send e-mail notifications."; + description = "Whenever to send e-mail notifications."; }; sender = mkOption { default = "root"; example = "example@domain.tld"; type = types.str; - description = lib.mdDoc '' + description = '' Sender of the notification messages. Acts as the value of `email` in the emails' `From: ...` field. ''; @@ -143,13 +143,13 @@ in recipient = mkOption { default = "root"; type = types.str; - description = lib.mdDoc "Recipient of the notification messages."; + description = "Recipient of the notification messages."; }; mailer = mkOption { default = "/run/wrappers/bin/sendmail"; type = types.path; - description = lib.mdDoc '' + description = '' Sendmail-compatible binary to be used to send the messages. You should probably enable @@ -163,7 +163,7 @@ in enable = mkOption { default = true; type = types.bool; - description = lib.mdDoc "Whenever to send wall notifications to all users."; + description = "Whenever to send wall notifications to all users."; }; }; @@ -172,21 +172,21 @@ in default = config.services.xserver.enable; defaultText = literalExpression "config.services.xserver.enable"; type = types.bool; - description = lib.mdDoc "Whenever to send X11 xmessage notifications."; + description = "Whenever to send X11 xmessage notifications."; }; display = mkOption { default = ":${toString config.services.xserver.display}"; defaultText = literalExpression ''":''${toString config.services.xserver.display}"''; type = types.str; - description = lib.mdDoc "DISPLAY to send X11 notifications to."; + description = "DISPLAY to send X11 notifications to."; }; }; test = mkOption { default = false; type = types.bool; - description = lib.mdDoc "Whenever to send a test notification on startup."; + description = "Whenever to send a test notification on startup."; }; }; @@ -196,7 +196,7 @@ in default = "-a"; type = types.separatedString " "; example = "-a -o on -s (S/../.././02|L/../../7/04)"; - description = lib.mdDoc '' + description = '' Common default options for explicitly monitored (listed in {option}`services.smartd.devices`) devices. @@ -213,7 +213,7 @@ in default = cfg.defaults.monitored; defaultText = literalExpression "config.${opt.defaults.monitored}"; type = types.separatedString " "; - description = lib.mdDoc '' + description = '' Like {option}`services.smartd.defaults.monitored`, but for the autodetected devices. ''; @@ -224,7 +224,7 @@ in default = []; example = [ { device = "/dev/sda"; } { device = "/dev/sdb"; options = "-d sat"; } ]; type = with types; listOf (submodule smartdDeviceOpts); - description = lib.mdDoc "List of devices to monitor."; + description = "List of devices to monitor."; }; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/snmpd.nix b/nixpkgs/nixos/modules/services/monitoring/snmpd.nix index f2d3953e6a62..bff9ce3fbc88 100644 --- a/nixpkgs/nixos/modules/services/monitoring/snmpd.nix +++ b/nixpkgs/nixos/modules/services/monitoring/snmpd.nix @@ -15,7 +15,7 @@ in { listenAddress = lib.mkOption { type = lib.types.str; default = "0.0.0.0"; - description = lib.mdDoc '' + description = '' The address to listen on for SNMP and AgentX messages. ''; example = "127.0.0.1"; @@ -24,7 +24,7 @@ in { port = lib.mkOption { type = lib.types.port; default = 161; - description = lib.mdDoc '' + description = '' The port to listen on for SNMP and AgentX messages. ''; }; @@ -32,7 +32,7 @@ in { openFirewall = lib.mkOption { type = lib.types.bool; default = false; - description = lib.mdDoc '' + description = '' Open port in firewall for snmpd. ''; }; @@ -40,7 +40,7 @@ in { configText = lib.mkOption { type = lib.types.lines; default = ""; - description = lib.mdDoc '' + description = '' The contents of the snmpd.conf. If the {option}`configFile` option is set, this value will be ignored. @@ -54,7 +54,7 @@ in { type = lib.types.path; default = configFile; defaultText = lib.literalMD "The value of {option}`configText`."; - description = lib.mdDoc '' + description = '' Path to the snmpd.conf file. By default, if {option}`configText` is set, a config file will be automatically generated. ''; diff --git a/nixpkgs/nixos/modules/services/monitoring/statsd.nix b/nixpkgs/nixos/modules/services/monitoring/statsd.nix index bbc1c7146a84..30b2916a9928 100644 --- a/nixpkgs/nixos/modules/services/monitoring/statsd.nix +++ b/nixpkgs/nixos/modules/services/monitoring/statsd.nix @@ -56,34 +56,34 @@ in options.services.statsd = { - enable = mkEnableOption (lib.mdDoc "statsd"); + enable = mkEnableOption "statsd"; listenAddress = mkOption { - description = lib.mdDoc "Address that statsd listens on over UDP"; + description = "Address that statsd listens on over UDP"; default = "127.0.0.1"; type = types.str; }; port = mkOption { - description = lib.mdDoc "Port that stats listens for messages on over UDP"; + description = "Port that stats listens for messages on over UDP"; default = 8125; type = types.int; }; mgmt_address = mkOption { - description = lib.mdDoc "Address to run management TCP interface on"; + description = "Address to run management TCP interface on"; default = "127.0.0.1"; type = types.str; }; mgmt_port = mkOption { - description = lib.mdDoc "Port to run the management TCP interface on"; + description = "Port to run the management TCP interface on"; default = 8126; type = types.int; }; backends = mkOption { - description = lib.mdDoc "List of backends statsd will use for data persistence"; + description = "List of backends statsd will use for data persistence"; default = []; example = [ "graphite" @@ -97,19 +97,19 @@ in }; graphiteHost = mkOption { - description = lib.mdDoc "Hostname or IP of Graphite server"; + description = "Hostname or IP of Graphite server"; default = null; type = types.nullOr types.str; }; graphitePort = mkOption { - description = lib.mdDoc "Port of Graphite server (i.e. carbon-cache)."; + description = "Port of Graphite server (i.e. carbon-cache)."; default = null; type = types.nullOr types.int; }; extraConfig = mkOption { - description = lib.mdDoc "Extra configuration options for statsd"; + description = "Extra configuration options for statsd"; default = ""; type = types.nullOr types.str; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/sysstat.nix b/nixpkgs/nixos/modules/services/monitoring/sysstat.nix index 5468fc3aa454..ca2cff827232 100644 --- a/nixpkgs/nixos/modules/services/monitoring/sysstat.nix +++ b/nixpkgs/nixos/modules/services/monitoring/sysstat.nix @@ -5,12 +5,12 @@ let in { options = { services.sysstat = { - enable = mkEnableOption (lib.mdDoc "sar system activity collection"); + enable = mkEnableOption "sar system activity collection"; collect-frequency = mkOption { type = types.str; default = "*:00/10"; - description = lib.mdDoc '' + description = '' OnCalendar specification for sysstat-collect ''; }; @@ -18,7 +18,7 @@ in { collect-args = mkOption { type = types.str; default = "1 1"; - description = lib.mdDoc '' + description = '' Arguments to pass sa1 when collecting statistics ''; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/teamviewer.nix b/nixpkgs/nixos/modules/services/monitoring/teamviewer.nix index 7c45247aa6d5..360cdd1c6b6a 100644 --- a/nixpkgs/nixos/modules/services/monitoring/teamviewer.nix +++ b/nixpkgs/nixos/modules/services/monitoring/teamviewer.nix @@ -14,7 +14,7 @@ in options = { - services.teamviewer.enable = mkEnableOption (lib.mdDoc "TeamViewer daemon"); + services.teamviewer.enable = mkEnableOption "TeamViewer daemon"; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/telegraf.nix b/nixpkgs/nixos/modules/services/monitoring/telegraf.nix index 3bab8aba7bd6..8c51a2838e05 100644 --- a/nixpkgs/nixos/modules/services/monitoring/telegraf.nix +++ b/nixpkgs/nixos/modules/services/monitoring/telegraf.nix @@ -11,7 +11,7 @@ in { ###### interface options = { services.telegraf = { - enable = mkEnableOption (lib.mdDoc "telegraf server"); + enable = mkEnableOption "telegraf server"; package = mkPackageOption pkgs "telegraf" { }; @@ -19,7 +19,7 @@ in { type = types.listOf types.path; default = []; example = [ "/run/keys/telegraf.env" ]; - description = lib.mdDoc '' + description = '' File to load as environment file. Environment variables from this file will be interpolated into the config file using envsubst with this syntax: `$ENVIRONMENT` or `''${VARIABLE}`. @@ -29,7 +29,7 @@ in { extraConfig = mkOption { default = {}; - description = lib.mdDoc "Extra configuration options for telegraf"; + description = "Extra configuration options for telegraf"; type = settingsFormat.type; example = { outputs.influxdb = { diff --git a/nixpkgs/nixos/modules/services/monitoring/thanos.nix b/nixpkgs/nixos/modules/services/monitoring/thanos.nix index 02502816ef5d..f4cec0a545cb 100644 --- a/nixpkgs/nixos/modules/services/monitoring/thanos.nix +++ b/nixpkgs/nixos/modules/services/monitoring/thanos.nix @@ -14,7 +14,6 @@ let literalMD mapAttrsRecursiveCond mapAttrsToList - mdDoc mkEnableOption mkIf mkMerge @@ -31,7 +30,7 @@ let nullOpt = type: description: mkOption { type = types.nullOr type; default = null; - description = mdDoc description; + description = description; }; optionToArgs = opt: v : optional (v != null) ''--${opt}="${toString v}"''; @@ -55,7 +54,7 @@ let option = mkOption { type = types.bool; default = false; - description = mdDoc description; + description = description; }; }; @@ -64,7 +63,7 @@ let option = mkOption { type = types.listOf types.str; default = []; - description = mdDoc description; + description = description; }; }; @@ -73,7 +72,7 @@ let option = mkOption { type = types.attrsOf types.str; default = {}; - description = mdDoc description; + description = description; }; }; @@ -82,7 +81,7 @@ let option = mkOption { type = types.str; inherit default; - description = mdDoc description; + description = description; }; }; @@ -109,7 +108,7 @@ let defaultText = literalMD '' calculated from `config.services.thanos.${cmd}` ''; - description = mdDoc '' + description = '' Arguments to the `thanos ${cmd}` command. Defaults to a list of arguments formed by converting the structured @@ -150,7 +149,7 @@ let if config.services.thanos.<cmd>.tracing.config == null then null else toString (toYAML "tracing.yaml" config.services.thanos.<cmd>.tracing.config); ''; - description = mdDoc '' + description = '' Path to YAML file that contains tracing configuration. See format details: <https://thanos.io/tip/thanos/tracing.md/#configuration> @@ -215,7 +214,7 @@ let if config.services.thanos.<cmd>.objstore.config == null then null else toString (toYAML "objstore.yaml" config.services.thanos.<cmd>.objstore.config); ''; - description = mdDoc '' + description = '' Path to YAML file that contains object store configuration. See format details: <https://thanos.io/tip/thanos/storage.md/#configuring-access-to-object-storage> @@ -254,7 +253,7 @@ let type = types.str; default = "/var/lib/${config.services.prometheus.stateDir}/data"; defaultText = literalExpression ''"/var/lib/''${config.services.prometheus.stateDir}/data"''; - description = mdDoc '' + description = '' Data directory of TSDB. ''; }; @@ -353,6 +352,10 @@ let See <https://tools.ietf.org/html/rfc4366#section-3.1> ''; + grpc-compression = mkParam types.str '' + Compression algorithm to use for gRPC requests to other clients. + ''; + web.route-prefix = mkParam types.str '' Prefix for API and UI endpoints. @@ -642,6 +645,10 @@ let receive = params.common cfg.receive // params.objstore cfg.receive // { + receive.grpc-compression = mkParam types.str '' + Compression algorithm to use for gRPC requests to other receivers. + ''; + remote-write.address = mkParamDef types.str "0.0.0.0:19291" '' Address to listen on for remote write requests. ''; @@ -684,53 +691,45 @@ in { package = mkPackageOption pkgs "thanos" {}; sidecar = paramsToOptions params.sidecar // { - enable = mkEnableOption - (mdDoc "the Thanos sidecar for Prometheus server"); + enable = mkEnableOption "the Thanos sidecar for Prometheus server"; arguments = mkArgumentsOption "sidecar"; }; store = paramsToOptions params.store // { - enable = mkEnableOption - (mdDoc "the Thanos store node giving access to blocks in a bucket provider."); + enable = mkEnableOption "the Thanos store node giving access to blocks in a bucket provider."; arguments = mkArgumentsOption "store"; }; query = paramsToOptions params.query // { - enable = mkEnableOption - (mdDoc ("the Thanos query node exposing PromQL enabled Query API " + - "with data retrieved from multiple store nodes")); + enable = mkEnableOption ("the Thanos query node exposing PromQL enabled Query API " + + "with data retrieved from multiple store nodes"); arguments = mkArgumentsOption "query"; }; query-frontend = paramsToOptions params.query-frontend // { - enable = mkEnableOption - (mdDoc ("the Thanos query frontend implements a service deployed in front of queriers to - improve query parallelization and caching.")); + enable = mkEnableOption ("the Thanos query frontend implements a service deployed in front of queriers to + improve query parallelization and caching."); arguments = mkArgumentsOption "query-frontend"; }; rule = paramsToOptions params.rule // { - enable = mkEnableOption - (mdDoc ("the Thanos ruler service which evaluates Prometheus rules against" + - " given Query nodes, exposing Store API and storing old blocks in bucket")); + enable = mkEnableOption ("the Thanos ruler service which evaluates Prometheus rules against" + + " given Query nodes, exposing Store API and storing old blocks in bucket"); arguments = mkArgumentsOption "rule"; }; compact = paramsToOptions params.compact // { - enable = mkEnableOption - (mdDoc "the Thanos compactor which continuously compacts blocks in an object store bucket"); + enable = mkEnableOption "the Thanos compactor which continuously compacts blocks in an object store bucket"; arguments = mkArgumentsOption "compact"; }; downsample = paramsToOptions params.downsample // { - enable = mkEnableOption - (mdDoc "the Thanos downsampler which continuously downsamples blocks in an object store bucket"); + enable = mkEnableOption "the Thanos downsampler which continuously downsamples blocks in an object store bucket"; arguments = mkArgumentsOption "downsample"; }; receive = paramsToOptions params.receive // { - enable = mkEnableOption - (mdDoc ("the Thanos receiver which accept Prometheus remote write API requests and write to local tsdb")); + enable = mkEnableOption ("the Thanos receiver which accept Prometheus remote write API requests and write to local tsdb"); arguments = mkArgumentsOption "receive"; }; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/tremor-rs.nix b/nixpkgs/nixos/modules/services/monitoring/tremor-rs.nix index 213e8a474868..c8a77ab93def 100644 --- a/nixpkgs/nixos/modules/services/monitoring/tremor-rs.nix +++ b/nixpkgs/nixos/modules/services/monitoring/tremor-rs.nix @@ -11,34 +11,34 @@ in { options = { services.tremor-rs = { - enable = lib.mkEnableOption (lib.mdDoc "Tremor event- or stream-processing system"); + enable = lib.mkEnableOption "Tremor event- or stream-processing system"; troyFileList = mkOption { type = types.listOf types.path; default = []; - description = lib.mdDoc "List of troy files to load."; + description = "List of troy files to load."; }; tremorLibDir = mkOption { type = types.path; default = ""; - description = lib.mdDoc "Directory where to find /lib containing tremor script files"; + description = "Directory where to find /lib containing tremor script files"; }; host = mkOption { type = types.str; default = "127.0.0.1"; - description = lib.mdDoc "The host tremor should be listening on"; + description = "The host tremor should be listening on"; }; port = mkOption { type = types.port; default = 9898; - description = lib.mdDoc "the port tremor should be listening on"; + description = "the port tremor should be listening on"; }; loggerSettings = mkOption { - description = lib.mdDoc "Tremor logger configuration"; + description = "Tremor logger configuration"; default = {}; type = loggerSettingsFormat.type; diff --git a/nixpkgs/nixos/modules/services/monitoring/tuptime.nix b/nixpkgs/nixos/modules/services/monitoring/tuptime.nix index 97cc37526254..334f911a6c71 100644 --- a/nixpkgs/nixos/modules/services/monitoring/tuptime.nix +++ b/nixpkgs/nixos/modules/services/monitoring/tuptime.nix @@ -10,19 +10,19 @@ in { options.services.tuptime = { - enable = mkEnableOption (lib.mdDoc "the total uptime service"); + enable = mkEnableOption "the total uptime service"; timer = { enable = mkOption { type = types.bool; default = true; - description = lib.mdDoc "Whether to regularly log uptime to detect bad shutdowns."; + description = "Whether to regularly log uptime to detect bad shutdowns."; }; period = mkOption { type = types.str; default = "*:0/5"; - description = lib.mdDoc "systemd calendar event"; + description = "systemd calendar event"; }; }; }; diff --git a/nixpkgs/nixos/modules/services/monitoring/unpoller.nix b/nixpkgs/nixos/modules/services/monitoring/unpoller.nix index 557e2bff4c26..1b4acb5d938f 100644 --- a/nixpkgs/nixos/modules/services/monitoring/unpoller.nix +++ b/nixpkgs/nixos/modules/services/monitoring/unpoller.nix @@ -15,13 +15,13 @@ in { ]; options.services.unpoller = { - enable = mkEnableOption (lib.mdDoc "unpoller"); + enable = mkEnableOption "unpoller"; poller = { debug = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Turns on line numbers, microsecond logging, and a per-device log. This may be noisy if you have a lot of devices. It adds one line per device. ''; @@ -29,14 +29,14 @@ in { quiet = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Turns off per-interval logs. Only startup and error logs will be emitted. ''; }; plugins = mkOption { type = with types; listOf str; default = []; - description = lib.mdDoc '' + description = '' Load additional plugins. ''; }; @@ -46,21 +46,21 @@ in { disable = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Whether to disable the prometheus output plugin. ''; }; http_listen = mkOption { type = types.str; default = "[::]:9130"; - description = lib.mdDoc '' + description = '' Bind the prometheus exporter to this IP or hostname. ''; }; report_errors = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Whether to report errors. ''; }; @@ -70,21 +70,21 @@ in { disable = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Whether to disable the influxdb output plugin. ''; }; url = mkOption { type = types.str; default = "http://127.0.0.1:8086"; - description = lib.mdDoc '' + description = '' URL of the influxdb host. ''; }; user = mkOption { type = types.str; default = "unifipoller"; - description = lib.mdDoc '' + description = '' Username for the influxdb. ''; }; @@ -92,7 +92,7 @@ in { type = types.path; default = pkgs.writeText "unpoller-influxdb-default.password" "unifipoller"; defaultText = literalExpression "unpoller-influxdb-default.password"; - description = lib.mdDoc '' + description = '' Path of a file containing the password for influxdb. This file needs to be readable by the unifi-poller user. ''; @@ -101,21 +101,21 @@ in { db = mkOption { type = types.str; default = "unifi"; - description = lib.mdDoc '' + description = '' Database name. Database should exist. ''; }; verify_ssl = mkOption { type = types.bool; default = true; - description = lib.mdDoc '' + description = '' Verify the influxdb's certificate. ''; }; interval = mkOption { type = types.str; default = "30s"; - description = lib.mdDoc '' + description = '' Setting this lower than the Unifi controller's refresh interval may lead to zeroes in your database. ''; @@ -126,14 +126,14 @@ in { url = mkOption { type = types.str; default = ""; - description = lib.mdDoc '' + description = '' URL of the Loki host. ''; }; user = mkOption { type = types.str; default = ""; - description = lib.mdDoc '' + description = '' Username for Loki. ''; }; @@ -141,7 +141,7 @@ in { type = types.path; default = pkgs.writeText "unpoller-loki-default.password" ""; defaultText = "unpoller-influxdb-default.password"; - description = lib.mdDoc '' + description = '' Path of a file containing the password for Loki. This file needs to be readable by the unifi-poller user. ''; @@ -150,28 +150,28 @@ in { verify_ssl = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Verify Loki's certificate. ''; }; tenant_id = mkOption { type = types.str; default = ""; - description = lib.mdDoc '' + description = '' Tenant ID to use in Loki. ''; }; interval = mkOption { type = types.str; default = "2m"; - description = lib.mdDoc '' + description = '' How often the events are polled and pushed to Loki. ''; }; timeout = mkOption { type = types.str; default = "10s"; - description = lib.mdDoc '' + description = '' Should be increased in case of timeout errors. ''; }; @@ -182,7 +182,7 @@ in { user = mkOption { type = types.str; default = "unifi"; - description = lib.mdDoc '' + description = '' Unifi service user name. ''; }; @@ -190,7 +190,7 @@ in { type = types.path; default = pkgs.writeText "unpoller-unifi-default.password" "unifi"; defaultText = literalExpression "unpoller-unifi-default.password"; - description = lib.mdDoc '' + description = '' Path of a file containing the password for the unifi service user. This file needs to be readable by the unifi-poller user. ''; @@ -199,14 +199,14 @@ in { url = mkOption { type = types.str; default = "https://unifi:8443"; - description = lib.mdDoc '' + description = '' URL of the Unifi controller. ''; }; sites = mkOption { type = with types; either (enum [ "default" "all" ]) (listOf str); default = "all"; - description = lib.mdDoc '' + description = '' List of site names for which statistics should be exported. Or the string "default" for the default site or the string "all" for all sites. ''; @@ -215,35 +215,35 @@ in { save_ids = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Collect and save data from the intrusion detection system to influxdb and Loki. ''; }; save_events = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Collect and save data from UniFi events to influxdb and Loki. ''; }; save_alarms = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Collect and save data from UniFi alarms to influxdb and Loki. ''; }; save_anomalies = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Collect and save data from UniFi anomalies to influxdb and Loki. ''; }; save_dpi = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Collect and save data from deep packet inspection. Adds around 150 data points and impacts performance. ''; @@ -251,14 +251,14 @@ in { save_sites = mkOption { type = types.bool; default = true; - description = lib.mdDoc '' + description = '' Collect and save site data. ''; }; hash_pii = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Hash, with md5, client names and MAC addresses. This attempts to protect personally identifiable information. ''; @@ -266,7 +266,7 @@ in { verify_ssl = mkOption { type = types.bool; default = true; - description = lib.mdDoc '' + description = '' Verify the Unifi controller's certificate. ''; }; @@ -276,7 +276,7 @@ in { dynamic = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Let prometheus select which controller to poll when scraping. Use with default credentials. See unifi-poller wiki for more. ''; @@ -287,7 +287,7 @@ in { controllers = mkOption { type = with types; listOf (submodule { options = controllerOptions; }); default = []; - description = lib.mdDoc '' + description = '' List of Unifi controllers to poll. Use defaults if empty. ''; apply = map (flip removeAttrs [ "_module" ]); diff --git a/nixpkgs/nixos/modules/services/monitoring/ups.nix b/nixpkgs/nixos/modules/services/monitoring/ups.nix index 63afb5deb5bd..0a0d5eadccd3 100644 --- a/nixpkgs/nixos/modules/services/monitoring/ups.nix +++ b/nixpkgs/nixos/modules/services/monitoring/ups.nix @@ -90,7 +90,7 @@ let # /nix/store/nut/share/driver.list driver = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Specify the program to run to talk to this UPS. apcsmart, bestups, and sec are some examples. ''; @@ -98,7 +98,7 @@ let port = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' The serial port to which your UPS is connected. /dev/ttyS0 is usually the first port on Linux boxes, for example. ''; @@ -107,7 +107,7 @@ let shutdownOrder = mkOption { default = 0; type = types.int; - description = lib.mdDoc '' + description = '' When you have multiple UPSes on your system, you usually need to turn them off in a certain order. upsdrvctl shuts down all the 0s, then the 1s, 2s, and so on. To exclude a UPS from the @@ -118,7 +118,7 @@ let maxStartDelay = mkOption { default = null; type = types.uniq (types.nullOr types.int); - description = lib.mdDoc '' + description = '' This can be set as a global variable above your first UPS definition and it can also be set in a UPS section. This value controls how long upsdrvctl will wait for the driver to finish @@ -130,7 +130,7 @@ let description = mkOption { default = ""; type = types.str; - description = lib.mdDoc '' + description = '' Description of the UPS. ''; }; @@ -138,7 +138,7 @@ let directives = mkOption { default = []; type = types.listOf types.str; - description = lib.mdDoc '' + description = '' List of configuration directives for this UPS. ''; }; @@ -146,7 +146,7 @@ let summary = mkOption { default = ""; type = types.lines; - description = lib.mdDoc '' + description = '' Lines which would be added inside ups.conf for handling this UPS. ''; }; @@ -173,7 +173,7 @@ let options = { address = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Address of the interface for `upsd` to listen on. See `man upsd.conf` for details. ''; @@ -182,7 +182,7 @@ let port = mkOption { type = types.port; default = defaultPort; - description = lib.mdDoc '' + description = '' TCP port for `upsd` to listen on. See `man upsd.conf` for details. ''; @@ -195,7 +195,7 @@ let enable = mkOption { type = types.bool; defaultText = literalMD "`true` if `mode` is one of `standalone`, `netserver`"; - description = mdDoc "Whether to enable `upsd`."; + description = "Whether to enable `upsd`."; }; listen = mkOption { @@ -210,7 +210,7 @@ let port = 5923; } ]; - description = lib.mdDoc '' + description = '' Address of the interface for `upsd` to listen on. See `man upsd` for details`. ''; @@ -219,7 +219,7 @@ let extraConfig = mkOption { type = types.lines; default = ""; - description = lib.mdDoc '' + description = '' Additional lines to add to `upsd.conf`. ''; }; @@ -236,7 +236,7 @@ let system = mkOption { type = types.str; default = name; - description = lib.mdDoc '' + description = '' Identifier of the UPS to monitor, in this form: `<upsname>[@<hostname>[:<port>]]` See `upsmon.conf` for details. ''; @@ -245,7 +245,7 @@ let powerValue = mkOption { type = types.int; default = 1; - description = lib.mdDoc '' + description = '' Number of power supplies that the UPS feeds on this system. See `upsmon.conf` for details. ''; @@ -253,7 +253,7 @@ let user = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' Username from `upsd.users` for accessing this UPS. See `upsmon.conf` for details. ''; @@ -262,7 +262,7 @@ let passwordFile = mkOption { type = types.str; defaultText = literalMD "power.ups.users.\${user}.passwordFile"; - description = lib.mdDoc '' + description = '' The full path to a file containing the password from `upsd.users` for accessing this UPS. The password file is read on service start. @@ -273,7 +273,7 @@ let type = mkOption { type = types.str; default = "master"; - description = lib.mdDoc '' + description = '' The relationship with `upsd`. See `upsmon.conf` for details. ''; @@ -290,13 +290,13 @@ let enable = mkOption { type = types.bool; defaultText = literalMD "`true` if `mode` is one of `standalone`, `netserver`, `netclient`"; - description = mdDoc "Whether to enable `upsmon`."; + description = "Whether to enable `upsmon`."; }; monitor = mkOption { type = with types; attrsOf (submodule monitorOptions); default = {}; - description = lib.mdDoc '' + description = '' Set of UPS to monitor. See `man upsmon.conf` for details. ''; }; @@ -312,7 +312,7 @@ let SHUTDOWNCMD = "''${pkgs.systemd}/bin/shutdown now"; } ''; - description = mdDoc "Additional settings to add to `upsmon.conf`."; + description = "Additional settings to add to `upsmon.conf`."; example = literalMD '' { MINSUPPLIES = 2; @@ -341,7 +341,7 @@ let options = { passwordFile = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' The full path to a file that contains the user's (clear text) password. The password file is read on service start. ''; @@ -350,7 +350,7 @@ let actions = mkOption { type = with types; listOf str; default = []; - description = lib.mdDoc '' + description = '' Allow the user to do certain things with upsd. See `man upsd.users` for details. ''; @@ -359,7 +359,7 @@ let instcmds = mkOption { type = with types; listOf str; default = []; - description = lib.mdDoc '' + description = '' Let the user initiate specific instant commands. Use "ALL" to grant all commands automatically. For the full list of what your UPS supports, use "upscmd -l". See `man upsd.users` for details. ''; @@ -368,7 +368,7 @@ let upsmon = mkOption { type = with types; nullOr str; default = null; - description = lib.mdDoc '' + description = '' Add the necessary actions for a upsmon process to work. See `man upsd.users` for details. ''; @@ -384,15 +384,15 @@ in # powerManagement.powerDownCommands power.ups = { - enable = mkEnableOption (lib.mdDoc '' + enable = mkEnableOption '' Enables support for Power Devices, such as Uninterruptible Power Supplies, Power Distribution Units and Solar Controllers. - ''); + ''; mode = mkOption { default = "standalone"; type = types.enum [ "none" "standalone" "netserver" "netclient" ]; - description = lib.mdDoc '' + description = '' The MODE determines which part of the NUT is to be started, and which configuration files must be modified. @@ -419,7 +419,7 @@ in schedulerRules = mkOption { example = "/etc/nixos/upssched.conf"; type = types.str; - description = lib.mdDoc '' + description = '' File which contains the rules to handle UPS events. ''; }; @@ -427,7 +427,7 @@ in openFirewall = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Open ports in the firewall for `upsd`. ''; }; @@ -435,7 +435,7 @@ in maxStartDelay = mkOption { default = 45; type = types.int; - description = lib.mdDoc '' + description = '' This can be set as a global variable above your first UPS definition and it can also be set in a UPS section. This value controls how long upsdrvctl will wait for the driver to finish @@ -446,7 +446,7 @@ in upsmon = mkOption { default = {}; - description = lib.mdDoc '' + description = '' Options for the `upsmon.conf` configuration file. ''; type = types.submodule upsmonOptions; @@ -454,7 +454,7 @@ in upsd = mkOption { default = {}; - description = lib.mdDoc '' + description = '' Options for the `upsd.conf` configuration file. ''; type = types.submodule upsdOptions; @@ -463,7 +463,7 @@ in ups = mkOption { default = {}; # see nut/etc/ups.conf.sample - description = lib.mdDoc '' + description = '' This is where you configure all the UPSes that this system will be monitoring directly. These are usually attached to serial ports, but USB devices are also supported. @@ -473,7 +473,7 @@ in users = mkOption { default = {}; - description = lib.mdDoc '' + description = '' Users that can access upsd. See `man upsd.users`. ''; type = with types; attrsOf (submodule userOptions); diff --git a/nixpkgs/nixos/modules/services/monitoring/uptime-kuma.nix b/nixpkgs/nixos/modules/services/monitoring/uptime-kuma.nix index f3a41de7536a..4c7dd900f52b 100644 --- a/nixpkgs/nixos/modules/services/monitoring/uptime-kuma.nix +++ b/nixpkgs/nixos/modules/services/monitoring/uptime-kuma.nix @@ -11,11 +11,11 @@ in options = { services.uptime-kuma = { - enable = mkEnableOption (mdDoc "Uptime Kuma, this assumes a reverse proxy to be set"); + enable = mkEnableOption "Uptime Kuma, this assumes a reverse proxy to be set"; package = mkPackageOption pkgs "uptime-kuma" { }; - appriseSupport = mkEnableOption (mdDoc "apprise support for notifications"); + appriseSupport = mkEnableOption "apprise support for notifications"; settings = lib.mkOption { type = lib.types.submodule { freeformType = with lib.types; attrsOf str; }; @@ -24,7 +24,7 @@ in PORT = "4000"; NODE_EXTRA_CA_CERTS = "/etc/ssl/certs/ca-certificates.crt"; }; - description = lib.mdDoc '' + description = '' Additional configuration for Uptime Kuma, see <https://github.com/louislam/uptime-kuma/wiki/Environment-Variables> for supported values. diff --git a/nixpkgs/nixos/modules/services/monitoring/uptime.nix b/nixpkgs/nixos/modules/services/monitoring/uptime.nix index 7bf9e593c95e..79b86be6cc71 100644 --- a/nixpkgs/nixos/modules/services/monitoring/uptime.nix +++ b/nixpkgs/nixos/modules/services/monitoring/uptime.nix @@ -26,7 +26,7 @@ let in { options.services.uptime = { configFile = mkOption { - description = lib.mdDoc '' + description = '' The uptime configuration file If mongodb: server != localhost, please set usesRemoteMongo = true @@ -44,22 +44,22 @@ in { }; usesRemoteMongo = mkOption { - description = lib.mdDoc "Whether the configuration file specifies a remote mongo instance"; + description = "Whether the configuration file specifies a remote mongo instance"; default = false; type = types.bool; }; - enableWebService = mkEnableOption (lib.mdDoc "the uptime monitoring program web service"); + enableWebService = mkEnableOption "the uptime monitoring program web service"; - enableSeparateMonitoringService = mkEnableOption (lib.mdDoc "the uptime monitoring service") // { + enableSeparateMonitoringService = mkEnableOption "the uptime monitoring service" // { default = cfg.enableWebService; defaultText = literalExpression "config.${opt.enableWebService}"; }; nodeEnv = mkOption { - description = lib.mdDoc "The node environment to run in (development, production, etc.)"; + description = "The node environment to run in (development, production, etc.)"; type = types.str; diff --git a/nixpkgs/nixos/modules/services/monitoring/vmagent.nix b/nixpkgs/nixos/modules/services/monitoring/vmagent.nix index bd3ef756959d..4838e0709d09 100644 --- a/nixpkgs/nixos/modules/services/monitoring/vmagent.nix +++ b/nixpkgs/nixos/modules/services/monitoring/vmagent.nix @@ -1,65 +1,64 @@ { config, pkgs, lib, ... }: -with lib; + let cfg = config.services.vmagent; settingsFormat = pkgs.formats.json { }; in { - options.services.vmagent = { - enable = mkEnableOption (lib.mdDoc "vmagent"); - - user = mkOption { - default = "vmagent"; - type = types.str; - description = lib.mdDoc '' - User account under which vmagent runs. - ''; - }; + imports = [ + (lib.mkRemovedOptionModule [ "services" "vmagent" "dataDir" ] "dataDir has been deprecated in favor of systemd provided CacheDirectory") + (lib.mkRemovedOptionModule [ "services" "vmagent" "user" ] "user has been deprecated in favor of systemd DynamicUser") + (lib.mkRemovedOptionModule [ "services" "vmagent" "group" ] "group has been deprecated in favor of systemd DynamicUser") + (lib.mkRenamedOptionModule [ "services" "vmagent" "remoteWriteUrl" ] [ "services" "vmagent" "remoteWrite" "url" ]) + ]; - group = mkOption { - type = types.str; - default = "vmagent"; - description = lib.mdDoc '' - Group under which vmagent runs. - ''; - }; - - package = mkPackageOption pkgs "vmagent" { }; + options.services.vmagent = { + enable = lib.mkEnableOption "vmagent"; - dataDir = mkOption { - type = types.str; - default = "/var/lib/vmagent"; - description = lib.mdDoc '' - The directory where vmagent stores its data files. - ''; - }; + package = lib.mkPackageOption pkgs "vmagent" { }; - remoteWriteUrl = mkOption { - default = "http://localhost:8428/api/v1/write"; - type = types.str; - description = lib.mdDoc '' - The storage endpoint such as VictoriaMetrics - ''; + remoteWrite = { + url = lib.mkOption { + default = null; + type = lib.types.nullOr lib.types.str; + description = '' + Endpoint for prometheus compatible remote_write + ''; + }; + basicAuthUsername = lib.mkOption { + default = null; + type = lib.types.nullOr lib.types.str; + description = '' + Basic Auth username used to connect to remote_write endpoint + ''; + }; + basicAuthPasswordFile = lib.mkOption { + default = null; + type = lib.types.nullOr lib.types.str; + description = '' + File that contains the Basic Auth password used to connect to remote_write endpoint + ''; + }; }; - prometheusConfig = mkOption { + prometheusConfig = lib.mkOption { type = lib.types.submodule { freeformType = settingsFormat.type; }; - description = lib.mdDoc '' + description = '' Config for prometheus style metrics ''; }; - openFirewall = mkOption { - type = types.bool; + openFirewall = lib.mkOption { + type = lib.types.bool; default = false; - description = lib.mdDoc '' + description = '' Whether to open the firewall for the default ports. ''; }; - extraArgs = mkOption { - type = types.listOf types.str; + extraArgs = lib.mkOption { + type = lib.types.listOf lib.types.str; default = []; - description = lib.mdDoc '' + description = '' Extra args to pass to `vmagent`. See the docs: <https://docs.victoriametrics.com/vmagent.html#advanced-usage> or {command}`vmagent -help` for more information. @@ -67,37 +66,36 @@ in { }; }; - config = mkIf cfg.enable { - users.groups = mkIf (cfg.group == "vmagent") { vmagent = { }; }; - - users.users = mkIf (cfg.user == "vmagent") { - vmagent = { - group = cfg.group; - description = "vmagent daemon user"; - home = cfg.dataDir; - isSystemUser = true; - }; - }; - - networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ 8429 ]; + config = lib.mkIf cfg.enable { + networking.firewall.allowedTCPPorts = lib.mkIf cfg.openFirewall [ 8429 ]; systemd.services.vmagent = let prometheusConfig = settingsFormat.generate "prometheusConfig.yaml" cfg.prometheusConfig; + startCommandLine = lib.concatStringsSep " " ([ + "${cfg.package}/bin/vmagent" + "-promscrape.config=${prometheusConfig}" + ] ++ cfg.extraArgs + ++ lib.optionals (cfg.remoteWrite.url != null) [ + "-remoteWrite.url=${cfg.remoteWrite.url}" + "-remoteWrite.tmpDataPath=%C/vmagent/remote_write_tmp" + ] ++ lib.optional (cfg.remoteWrite.basicAuthUsername != null) "-remoteWrite.basicAuth.username=${cfg.remoteWrite.basicAuthUsername}" + ++ lib.optional (cfg.remoteWrite.basicAuthPasswordFile != null) "-remoteWrite.basicAuth.passwordFile=\${CREDENTIALS_DIRECTORY}/remote_write_basic_auth_password"); in { wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; description = "vmagent system service"; serviceConfig = { - User = cfg.user; - Group = cfg.group; + DynamicUser = true; + User = "vmagent"; + Group = "vmagent"; Type = "simple"; Restart = "on-failure"; - WorkingDirectory = cfg.dataDir; - ExecStart = "${cfg.package}/bin/vmagent -remoteWrite.url=${cfg.remoteWriteUrl} -promscrape.config=${prometheusConfig} ${escapeShellArgs cfg.extraArgs}"; + CacheDirectory = "vmagent"; + ExecStart = startCommandLine; + LoadCredential = lib.optional (cfg.remoteWrite.basicAuthPasswordFile != null) [ + "remote_write_basic_auth_password:${cfg.remoteWrite.basicAuthPasswordFile}" + ]; }; }; - - systemd.tmpfiles.rules = - [ "d '${cfg.dataDir}' 0755 ${cfg.user} ${cfg.group} -" ]; }; } diff --git a/nixpkgs/nixos/modules/services/monitoring/vmalert.nix b/nixpkgs/nixos/modules/services/monitoring/vmalert.nix index 1c64f7e100fa..65db6fab77db 100644 --- a/nixpkgs/nixos/modules/services/monitoring/vmalert.nix +++ b/nixpkgs/nixos/modules/services/monitoring/vmalert.nix @@ -20,7 +20,7 @@ in { # interface options.services.vmalert = { - enable = mkEnableOption (mdDoc "vmalert"); + enable = mkEnableOption "vmalert"; package = mkPackageOption pkgs "victoriametrics" { }; @@ -32,7 +32,7 @@ in "datasource.url" = mkOption { type = types.nonEmptyStr; example = "http://localhost:8428"; - description = mdDoc '' + description = '' Datasource compatible with Prometheus HTTP API. ''; }; @@ -41,14 +41,14 @@ in type = with types; listOf nonEmptyStr; default = []; example = [ "http://127.0.0.1:9093" ]; - description = mdDoc '' + description = '' Prometheus Alertmanager URL. List all Alertmanager URLs if it runs in the cluster mode to ensure high availability. ''; }; "rule" = mkOption { type = with types; listOf path; - description = mdDoc '' + description = '' Path to the files with alerting and/or recording rules. ::: {.note} @@ -70,7 +70,7 @@ in "dir/*.yaml" ]; }; - description = mdDoc '' + description = '' `vmalert` configuration, passed via command line flags. Refer to <https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/app/vmalert/README.md#configuration> for details on supported values. @@ -94,7 +94,7 @@ in } ]; }; - description = mdDoc '' + description = '' A list of the given alerting or recording rules against configured `"datasource.url"` compatible with Prometheus HTTP API for `vmalert` to execute. Refer to <https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/app/vmalert/README.md#rules> diff --git a/nixpkgs/nixos/modules/services/monitoring/vnstat.nix b/nixpkgs/nixos/modules/services/monitoring/vnstat.nix index a498962ae57e..5e19c399568d 100644 --- a/nixpkgs/nixos/modules/services/monitoring/vnstat.nix +++ b/nixpkgs/nixos/modules/services/monitoring/vnstat.nix @@ -6,7 +6,7 @@ let cfg = config.services.vnstat; in { options.services.vnstat = { - enable = mkEnableOption (lib.mdDoc "update of network usage statistics via vnstatd"); + enable = mkEnableOption "update of network usage statistics via vnstatd"; }; config = mkIf cfg.enable { diff --git a/nixpkgs/nixos/modules/services/monitoring/zabbix-agent.nix b/nixpkgs/nixos/modules/services/monitoring/zabbix-agent.nix index b195366123ab..b3850baa738b 100644 --- a/nixpkgs/nixos/modules/services/monitoring/zabbix-agent.nix +++ b/nixpkgs/nixos/modules/services/monitoring/zabbix-agent.nix @@ -29,7 +29,7 @@ in options = { services.zabbixAgent = { - enable = mkEnableOption (lib.mdDoc "the Zabbix Agent"); + enable = mkEnableOption "the Zabbix Agent"; package = mkPackageOption pkgs [ "zabbix" "agent" ] { }; @@ -38,7 +38,7 @@ in default = with pkgs; [ nettools ]; defaultText = literalExpression "with pkgs; [ nettools ]"; example = literalExpression "with pkgs; [ nettools mysql ]"; - description = lib.mdDoc '' + description = '' Packages to be added to the Zabbix {env}`PATH`. Typically used to add executables for scripts, but can be anything. ''; @@ -46,7 +46,7 @@ in modules = mkOption { type = types.attrsOf types.package; - description = lib.mdDoc "A set of modules to load."; + description = "A set of modules to load."; default = {}; example = literalExpression '' { @@ -66,7 +66,7 @@ in server = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' The IP address or hostname of the Zabbix server to connect to. ''; }; @@ -75,7 +75,7 @@ in ip = mkOption { type = types.str; default = "0.0.0.0"; - description = lib.mdDoc '' + description = '' List of comma delimited IP addresses that the agent should listen on. ''; }; @@ -83,7 +83,7 @@ in port = mkOption { type = types.port; default = 10050; - description = lib.mdDoc '' + description = '' Agent will listen on this port for connections from the server. ''; }; @@ -92,7 +92,7 @@ in openFirewall = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Open ports in the firewall for the Zabbix Agent. ''; }; @@ -100,7 +100,7 @@ in settings = mkOption { type = with types; attrsOf (oneOf [ int str (listOf str) ]); default = {}; - description = lib.mdDoc '' + description = '' Zabbix Agent configuration. Refer to <https://www.zabbix.com/documentation/current/manual/appendix/config/zabbix_agentd> for details on supported values. diff --git a/nixpkgs/nixos/modules/services/monitoring/zabbix-proxy.nix b/nixpkgs/nixos/modules/services/monitoring/zabbix-proxy.nix index fea5704af6f6..7fa471b6404a 100644 --- a/nixpkgs/nixos/modules/services/monitoring/zabbix-proxy.nix +++ b/nixpkgs/nixos/modules/services/monitoring/zabbix-proxy.nix @@ -38,11 +38,11 @@ in options = { services.zabbixProxy = { - enable = mkEnableOption (lib.mdDoc "the Zabbix Proxy"); + enable = mkEnableOption "the Zabbix Proxy"; server = mkOption { type = types.str; - description = lib.mdDoc '' + description = '' The IP address or hostname of the Zabbix server to connect to. ''; }; @@ -54,14 +54,14 @@ in else if cfg.database.type == "pgsql" then pkgs.zabbix.proxy-pgsql else pkgs.zabbix.proxy-sqlite; defaultText = literalExpression "pkgs.zabbix.proxy-pgsql"; - description = lib.mdDoc "The Zabbix package to use."; + description = "The Zabbix package to use."; }; extraPackages = mkOption { type = types.listOf types.package; default = with pkgs; [ nettools nmap traceroute ]; defaultText = literalExpression "[ nettools nmap traceroute ]"; - description = lib.mdDoc '' + description = '' Packages to be added to the Zabbix {env}`PATH`. Typically used to add executables for scripts, but can be anything. ''; @@ -69,7 +69,7 @@ in modules = mkOption { type = types.attrsOf types.package; - description = lib.mdDoc "A set of modules to load."; + description = "A set of modules to load."; default = {}; example = literalExpression '' { @@ -92,44 +92,44 @@ in type = types.enum [ "mysql" "pgsql" "sqlite" ]; example = "mysql"; default = "pgsql"; - description = lib.mdDoc "Database engine to use."; + description = "Database engine to use."; }; host = mkOption { type = types.str; default = "localhost"; - description = lib.mdDoc "Database host address."; + description = "Database host address."; }; port = mkOption { type = types.port; - default = if cfg.database.type == "mysql" then mysql.port else pgsql.port; + default = if cfg.database.type == "mysql" then mysql.port else pgsql.services.port; defaultText = literalExpression '' if config.${opt.database.type} == "mysql" then config.${options.services.mysql.port} - else config.${options.services.postgresql.port} + else config.services.postgresql.settings.port ''; - description = lib.mdDoc "Database host port."; + description = "Database host port."; }; name = mkOption { type = types.str; default = if cfg.database.type == "sqlite" then "${stateDir}/zabbix.db" else "zabbix"; defaultText = literalExpression "zabbix"; - description = lib.mdDoc "Database name."; + description = "Database name."; }; user = mkOption { type = types.str; default = "zabbix"; - description = lib.mdDoc "Database user."; + description = "Database user."; }; passwordFile = mkOption { type = types.nullOr types.path; default = null; example = "/run/keys/zabbix-dbpassword"; - description = lib.mdDoc '' + description = '' A file containing the password corresponding to {option}`database.user`. ''; @@ -139,13 +139,13 @@ in type = types.nullOr types.path; default = null; example = "/run/postgresql"; - description = lib.mdDoc "Path to the unix socket file to use for authentication."; + description = "Path to the unix socket file to use for authentication."; }; createLocally = mkOption { type = types.bool; default = true; - description = lib.mdDoc "Whether to create a local database automatically."; + description = "Whether to create a local database automatically."; }; }; @@ -153,7 +153,7 @@ in ip = mkOption { type = types.str; default = "0.0.0.0"; - description = lib.mdDoc '' + description = '' List of comma delimited IP addresses that the trapper should listen on. Trapper will listen on all network interfaces if this parameter is missing. ''; @@ -162,7 +162,7 @@ in port = mkOption { type = types.port; default = 10051; - description = lib.mdDoc '' + description = '' Listen port for trapper. ''; }; @@ -171,7 +171,7 @@ in openFirewall = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Open ports in the firewall for the Zabbix Proxy. ''; }; @@ -179,7 +179,7 @@ in settings = mkOption { type = with types; attrsOf (oneOf [ int str (listOf str) ]); default = {}; - description = lib.mdDoc '' + description = '' Zabbix Proxy configuration. Refer to <https://www.zabbix.com/documentation/current/manual/appendix/config/zabbix_proxy> for details on supported values. diff --git a/nixpkgs/nixos/modules/services/monitoring/zabbix-server.nix b/nixpkgs/nixos/modules/services/monitoring/zabbix-server.nix index f2fb5fbe7ac6..3c6f60b9d722 100644 --- a/nixpkgs/nixos/modules/services/monitoring/zabbix-server.nix +++ b/nixpkgs/nixos/modules/services/monitoring/zabbix-server.nix @@ -40,20 +40,20 @@ in options = { services.zabbixServer = { - enable = mkEnableOption (lib.mdDoc "the Zabbix Server"); + enable = mkEnableOption "the Zabbix Server"; package = mkOption { type = types.package; default = if cfg.database.type == "mysql" then pkgs.zabbix.server-mysql else pkgs.zabbix.server-pgsql; defaultText = literalExpression "pkgs.zabbix.server-pgsql"; - description = lib.mdDoc "The Zabbix package to use."; + description = "The Zabbix package to use."; }; extraPackages = mkOption { type = types.listOf types.package; default = with pkgs; [ nettools nmap traceroute ]; defaultText = literalExpression "[ nettools nmap traceroute ]"; - description = lib.mdDoc '' + description = '' Packages to be added to the Zabbix {env}`PATH`. Typically used to add executables for scripts, but can be anything. ''; @@ -61,7 +61,7 @@ in modules = mkOption { type = types.attrsOf types.package; - description = lib.mdDoc "A set of modules to load."; + description = "A set of modules to load."; default = {}; example = literalExpression '' { @@ -84,43 +84,43 @@ in type = types.enum [ "mysql" "pgsql" ]; example = "mysql"; default = "pgsql"; - description = lib.mdDoc "Database engine to use."; + description = "Database engine to use."; }; host = mkOption { type = types.str; default = "localhost"; - description = lib.mdDoc "Database host address."; + description = "Database host address."; }; port = mkOption { type = types.port; - default = if cfg.database.type == "mysql" then mysql.port else pgsql.port; + default = if cfg.database.type == "mysql" then mysql.port else pgsql.settings.port; defaultText = literalExpression '' if config.${opt.database.type} == "mysql" then config.${options.services.mysql.port} - else config.${options.services.postgresql.port} + else config.services.postgresql.settings.port ''; - description = lib.mdDoc "Database host port."; + description = "Database host port."; }; name = mkOption { type = types.str; default = "zabbix"; - description = lib.mdDoc "Database name."; + description = "Database name."; }; user = mkOption { type = types.str; default = "zabbix"; - description = lib.mdDoc "Database user."; + description = "Database user."; }; passwordFile = mkOption { type = types.nullOr types.path; default = null; example = "/run/keys/zabbix-dbpassword"; - description = lib.mdDoc '' + description = '' A file containing the password corresponding to {option}`database.user`. ''; @@ -130,13 +130,13 @@ in type = types.nullOr types.path; default = null; example = "/run/postgresql"; - description = lib.mdDoc "Path to the unix socket file to use for authentication."; + description = "Path to the unix socket file to use for authentication."; }; createLocally = mkOption { type = types.bool; default = true; - description = lib.mdDoc "Whether to create a local database automatically."; + description = "Whether to create a local database automatically."; }; }; @@ -144,7 +144,7 @@ in ip = mkOption { type = types.str; default = "0.0.0.0"; - description = lib.mdDoc '' + description = '' List of comma delimited IP addresses that the trapper should listen on. Trapper will listen on all network interfaces if this parameter is missing. ''; @@ -153,7 +153,7 @@ in port = mkOption { type = types.port; default = 10051; - description = lib.mdDoc '' + description = '' Listen port for trapper. ''; }; @@ -162,7 +162,7 @@ in openFirewall = mkOption { type = types.bool; default = false; - description = lib.mdDoc '' + description = '' Open ports in the firewall for the Zabbix Server. ''; }; @@ -170,7 +170,7 @@ in settings = mkOption { type = with types; attrsOf (oneOf [ int str (listOf str) ]); default = {}; - description = lib.mdDoc '' + description = '' Zabbix Server configuration. Refer to <https://www.zabbix.com/documentation/current/manual/appendix/config/zabbix_server> for details on supported values. |