Merge pull request #306640 from pyrox0/prometheus-exporter-with-removal

nixos/prometheus/exporters: Remove all `with lib;` usage
This commit is contained in:
Martin Weinelt 2024-04-25 17:25:34 +02:00 committed by GitHub
commit a1030cf5ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
66 changed files with 308 additions and 130 deletions

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.apcupsd; cfg = config.services.prometheus.exporters.apcupsd;
inherit (lib) mkOption types concatStringsSep;
in in
{ {
port = 9162; port = 9162;

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.artifactory; cfg = config.services.prometheus.exporters.artifactory;
inherit (lib) mkOption types concatStringsSep;
in in
{ {
port = 9531; port = 9531;

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.bind; cfg = config.services.prometheus.exporters.bind;
inherit (lib) mkOption types concatStringsSep;
in in
{ {
port = 9119; port = 9119;

View File

@ -1,9 +1,13 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.bird; cfg = config.services.prometheus.exporters.bird;
inherit (lib)
mkOption
types
concatStringsSep
singleton
;
in in
{ {
port = 9324; port = 9324;

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.bitcoin; cfg = config.services.prometheus.exporters.bitcoin;
inherit (lib) mkOption types concatStringsSep;
in in
{ {
port = 9332; port = 9332;

View File

@ -1,10 +1,14 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
logPrefix = "services.prometheus.exporter.blackbox"; logPrefix = "services.prometheus.exporter.blackbox";
cfg = config.services.prometheus.exporters.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 # This ensures that we can deal with string paths, path types and
# store-path strings with context. # store-path strings with context.

View File

@ -1,9 +1,14 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.buildkite-agent; cfg = config.services.prometheus.exporters.buildkite-agent;
inherit (lib)
mkOption
types
concatStringsSep
optionalString
literalExpression
;
in in
{ {
port = 9876; port = 9876;

View File

@ -1,9 +1,15 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.collectd; cfg = config.services.prometheus.exporters.collectd;
inherit (lib)
mkOption
mkEnableOption
types
optionalString
concatStringsSep
escapeShellArg
;
in in
{ {
port = 9103; port = 9103;

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.dmarc; cfg = config.services.prometheus.exporters.dmarc;
inherit (lib) mkOption types optionalString;
json = builtins.toJSON { json = builtins.toJSON {
inherit (cfg) folders port; inherit (cfg) folders port;

View File

@ -1,9 +1,13 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.dnsmasq; cfg = config.services.prometheus.exporters.dnsmasq;
inherit (lib)
mkOption
types
concatStringsSep
escapeShellArg
;
in in
{ {
port = 9153; port = 9153;

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.domain; cfg = config.services.prometheus.exporters.domain;
inherit (lib) concatStringsSep;
in in
{ {
port = 9222; port = 9222;

View File

@ -1,9 +1,13 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.dovecot; cfg = config.services.prometheus.exporters.dovecot;
inherit (lib)
mkOption
types
escapeShellArg
concatStringsSep
;
in in
{ {
port = 9166; port = 9166;

View File

@ -1,9 +1,14 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.flow; cfg = config.services.prometheus.exporters.flow;
inherit (lib)
mkOption
types
literalExpression
concatStringsSep
optionalString
;
in { in {
port = 9590; port = 9590;
extraOpts = { extraOpts = {

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.fritzbox; cfg = config.services.prometheus.exporters.fritzbox;
inherit (lib) mkOption types concatStringsSep;
in in
{ {
port = 9133; port = 9133;

View File

@ -1,8 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.idrac; cfg = config.services.prometheus.exporters.idrac;
inherit (lib) mkOption types;
configFile = if cfg.configurationPath != null configFile = if cfg.configurationPath != null
then cfg.configurationPath then cfg.configurationPath

View File

@ -1,7 +1,5 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.imap-mailstat; cfg = config.services.prometheus.exporters.imap-mailstat;
valueToString = value: valueToString = value:
@ -13,6 +11,15 @@ let
else "XXX ${toString value}" else "XXX ${toString value}"
) )
); );
inherit (lib)
mkOption
types
concatStrings
concatStringsSep
attrValues
mapAttrs
optionalString
;
createConfigFile = accounts: createConfigFile = accounts:
# unfortunately on toTOML yet # unfortunately on toTOML yet
# https://github.com/NixOS/nix/issues/3929 # https://github.com/NixOS/nix/issues/3929

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.influxdb; cfg = config.services.prometheus.exporters.influxdb;
inherit (lib) mkOption types concatStringsSep;
in in
{ {
port = 9122; port = 9122;

View File

@ -1,10 +1,15 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
logPrefix = "services.prometheus.exporter.ipmi"; logPrefix = "services.prometheus.exporter.ipmi";
cfg = config.services.prometheus.exporters.ipmi; cfg = config.services.prometheus.exporters.ipmi;
inherit (lib)
mkOption
types
concatStringsSep
optionals
escapeShellArg
;
in { in {
port = 9290; port = 9290;

View File

@ -1,9 +1,13 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.jitsi; cfg = config.services.prometheus.exporters.jitsi;
inherit (lib)
mkOption
types
escapeShellArg
concatStringsSep
;
in in
{ {
port = 9700; port = 9700;

View File

@ -1,9 +1,14 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.json; cfg = config.services.prometheus.exporters.json;
inherit (lib)
mkOption
types
escapeShellArg
concatStringsSep
mkRemovedOptionModule
;
in in
{ {
port = 7979; port = 7979;

View File

@ -1,9 +1,14 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.junos-czerwonk; 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); configFile = if cfg.configuration != null then configurationFile else (escapeShellArg cfg.configurationFile);

View File

@ -5,10 +5,14 @@
, ... , ...
}: }:
with lib;
let let
cfg = config.services.prometheus.exporters.kea; cfg = config.services.prometheus.exporters.kea;
inherit (lib)
mkOption
types
mkRenamedOptionModule
literalExpression
;
in { in {
imports = [ imports = [
(mkRenamedOptionModule [ "controlSocketPaths" ] [ "targets" ]) (mkRenamedOptionModule [ "controlSocketPaths" ] [ "targets" ])

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.keylight; cfg = config.services.prometheus.exporters.keylight;
inherit (lib) concatStringsSep;
in in
{ {
port = 9288; port = 9288;

View File

@ -1,9 +1,13 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.knot; cfg = config.services.prometheus.exporters.knot;
inherit (lib)
mkOption
types
literalExpression
concatStringsSep
;
in { in {
port = 9433; port = 9433;
extraOpts = { extraOpts = {

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.lnd; cfg = config.services.prometheus.exporters.lnd;
inherit (lib) mkOption types concatStringsSep;
in in
{ {
port = 9092; port = 9092;

View File

@ -1,9 +1,19 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.mail; 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); configFile = if cfg.configuration != null then configurationFile else (escapeShellArg cfg.configFile);

View File

@ -1,9 +1,14 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.mikrotik; cfg = config.services.prometheus.exporters.mikrotik;
inherit (lib)
mkOption
types
literalExpression
concatStringsSep
escapeShellArg
;
in in
{ {
port = 9436; port = 9436;

View File

@ -1,9 +1,14 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.minio; cfg = config.services.prometheus.exporters.minio;
inherit (lib)
mkOption
types
optionalString
concatStringsSep
escapeShellArg
;
in in
{ {
port = 9290; port = 9290;

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.modemmanager; cfg = config.services.prometheus.exporters.modemmanager;
inherit (lib) mkOption types concatStringsSep;
in in
{ {
port = 9539; port = 9539;

View File

@ -1,9 +1,17 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.mongodb; cfg = config.services.prometheus.exporters.mongodb;
inherit (lib)
mkOption
types
optionalString
getExe
length
concatStringsSep
concatMapStringsSep
escapeShellArgs
;
in in
{ {
port = 9216; port = 9216;

View File

@ -1,11 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.nats; cfg = config.services.prometheus.exporters.nats;
inherit (lib) mkOption types concatStringsSep;
in in
{ {
port = 7777; port = 7777;

View File

@ -1,9 +1,13 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.nextcloud; cfg = config.services.prometheus.exporters.nextcloud;
inherit (lib)
mkOption
types
escapeShellArg
concatStringsSep
;
in in
{ {
port = 9205; port = 9205;

View File

@ -1,9 +1,16 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.nginx; cfg = config.services.prometheus.exporters.nginx;
inherit (lib)
mkOption
types
mkMerge
mkRemovedOptionModule
mkRenamedOptionModule
mkIf
concatStringsSep
;
in in
{ {
port = 9113; port = 9113;

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.nginxlog; cfg = config.services.prometheus.exporters.nginxlog;
inherit (lib) mkOption types;
in { in {
port = 9117; port = 9117;
extraOpts = { extraOpts = {

View File

@ -1,9 +1,15 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.node; cfg = config.services.prometheus.exporters.node;
inherit (lib)
mkOption
types
concatStringsSep
concatMapStringsSep
any
optionals
;
collectorIsEnabled = final: any (collector: (final == collector)) cfg.enabledCollectors; collectorIsEnabled = final: any (collector: (final == collector)) cfg.enabledCollectors;
collectorIsDisabled = final: any (collector: (final == collector)) cfg.disabledCollectors; collectorIsDisabled = final: any (collector: (final == collector)) cfg.disabledCollectors;
in in

View File

@ -1,9 +1,13 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.nut; cfg = config.services.prometheus.exporters.nut;
inherit (lib)
mkOption
types
optionalString
concatStringsSep
;
in in
{ {
port = 9199; port = 9199;

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.openldap; cfg = config.services.prometheus.exporters.openldap;
inherit (lib) mkOption types concatStringsSep;
in { in {
port = 9330; port = 9330;
extraOpts = { extraOpts = {

View File

@ -1,9 +1,14 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.pgbouncer; cfg = config.services.prometheus.exporters.pgbouncer;
inherit (lib)
mkOption
types
optionals
escapeShellArg
concatStringsSep
;
in in
{ {
port = 9127; port = 9127;

View File

@ -1,9 +1,13 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.pihole; cfg = config.services.prometheus.exporters.pihole;
inherit (lib)
mkOption
types
mkRemovedOptionModule
optionalString
;
in in
{ {
imports = [ imports = [

View File

@ -1,9 +1,9 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.ping; cfg = config.services.prometheus.exporters.ping;
inherit (lib) mkOption types concatStringsSep;
settingsFormat = pkgs.formats.yaml {}; settingsFormat = pkgs.formats.yaml {};
configFile = settingsFormat.generate "config.yml" cfg.settings; configFile = settingsFormat.generate "config.yml" cfg.settings;

View File

@ -1,9 +1,15 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.postfix; cfg = config.services.prometheus.exporters.postfix;
inherit (lib)
mkOption
types
mkIf
escapeShellArg
concatStringsSep
optional
;
in in
{ {
port = 9154; port = 9154;

View File

@ -1,9 +1,14 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.postgres; cfg = config.services.prometheus.exporters.postgres;
inherit (lib)
mkOption
types
mkIf
mkForce
concatStringsSep
;
in in
{ {
port = 9187; port = 9187;

View File

@ -1,9 +1,13 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.process; cfg = config.services.prometheus.exporters.process;
inherit (lib)
mkOption
types
literalExpression
concatStringsSep
;
configFile = pkgs.writeText "process-exporter.yaml" (builtins.toJSON cfg.settings); configFile = pkgs.writeText "process-exporter.yaml" (builtins.toJSON cfg.settings);
in in
{ {

View File

@ -1,8 +1,14 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.pve; 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 # pve exporter requires a config file so create an empty one if configFile is not provided
emptyConfigFile = pkgs.writeTextFile { emptyConfigFile = pkgs.writeTextFile {

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.py-air-control; cfg = config.services.prometheus.exporters.py-air-control;
inherit (lib) mkOption types;
workingDir = "/var/lib/${cfg.stateDir}"; workingDir = "/var/lib/${cfg.stateDir}";

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.redis; cfg = config.services.prometheus.exporters.redis;
inherit (lib) concatStringsSep;
in in
{ {
port = 9121; port = 9121;

View File

@ -1,9 +1,18 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.restic; cfg = config.services.prometheus.exporters.restic;
inherit (lib)
mkOption
types
concatStringsSep
mkIf
mapAttrs'
splitString
toUpper
optionalAttrs
nameValuePair
;
in in
{ {
port = 9753; port = 9753;

View File

@ -1,9 +1,16 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.rspamd; cfg = config.services.prometheus.exporters.rspamd;
inherit (lib)
mkOption
types
replaceStrings
mkRemovedOptionModule
recursiveUpdate
concatStringsSep
literalExpression
;
mkFile = conf: mkFile = conf:
pkgs.writeText "rspamd-exporter-config.yml" (builtins.toJSON conf); pkgs.writeText "rspamd-exporter-config.yml" (builtins.toJSON conf);

View File

@ -1,9 +1,13 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.script; cfg = config.services.prometheus.exporters.script;
inherit (lib)
mkOption
types
literalExpression
concatStringsSep
;
configFile = pkgs.writeText "script-exporter.yaml" (builtins.toJSON cfg.settings); configFile = pkgs.writeText "script-exporter.yaml" (builtins.toJSON cfg.settings);
in in
{ {

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.shelly; cfg = config.services.prometheus.exporters.shelly;
inherit (lib) mkOption types;
in in
{ {
port = 9784; port = 9784;

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.smartctl; cfg = config.services.prometheus.exporters.smartctl;
inherit (lib) mkOption types literalExpression;
args = lib.escapeShellArgs ([ args = lib.escapeShellArgs ([
"--web.listen-address=${cfg.listenAddress}:${toString cfg.port}" "--web.listen-address=${cfg.listenAddress}:${toString cfg.port}"
"--smartctl.path=${pkgs.smartmontools}/bin/smartctl" "--smartctl.path=${pkgs.smartmontools}/bin/smartctl"

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.smokeping; cfg = config.services.prometheus.exporters.smokeping;
inherit (lib) mkOption types concatStringsSep;
goDuration = types.mkOptionType { goDuration = types.mkOptionType {
name = "goDuration"; name = "goDuration";
description = "Go duration (https://golang.org/pkg/time/#ParseDuration)"; description = "Go duration (https://golang.org/pkg/time/#ParseDuration)";

View File

@ -1,10 +1,15 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
logPrefix = "services.prometheus.exporters.snmp"; logPrefix = "services.prometheus.exporters.snmp";
cfg = config.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 # This ensures that we can deal with string paths, path types and
# store-path strings with context. # store-path strings with context.

View File

@ -1,7 +1,13 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.sql; cfg = config.services.prometheus.exporters.sql;
inherit (lib)
mkOption
types
mapAttrs
mapAttrsToList
concatStringsSep
;
cfgOptions = { cfgOptions = {
options = with types; { options = with types; {
jobs = mkOption { jobs = mkOption {

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.statsd; cfg = config.services.prometheus.exporters.statsd;
inherit (lib) concatStringsSep;
in in
{ {
port = 9102; port = 9102;

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.surfboard; cfg = config.services.prometheus.exporters.surfboard;
inherit (lib) mkOption types concatStringsSep;
in in
{ {
port = 9239; port = 9239;

View File

@ -1,9 +1,8 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
with lib; let
cfg = config.services.prometheus.exporters.systemd;
let cfg = config.services.prometheus.exporters.systemd; inherit (lib) concatStringsSep;
in { in {
port = 9558; port = 9558;

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.tor; cfg = config.services.prometheus.exporters.tor;
inherit (lib) mkOption types concatStringsSep;
in in
{ {
port = 9130; port = 9130;

View File

@ -5,10 +5,17 @@
, ... , ...
}: }:
with lib;
let let
cfg = config.services.prometheus.exporters.unbound; cfg = config.services.prometheus.exporters.unbound;
inherit (lib)
mkOption
types
mkRemovedOptionModule
optionalAttrs
optionalString
mkMerge
mkIf
;
in in
{ {
imports = [ imports = [

View File

@ -1,9 +1,14 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.unifi; cfg = config.services.prometheus.exporters.unifi;
inherit (lib)
mkOption
types
escapeShellArg
optionalString
concatStringsSep
;
in in
{ {
port = 9130; port = 9130;

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.unpoller; cfg = config.services.prometheus.exporters.unpoller;
inherit (lib) mkEnableOption generators;
configFile = pkgs.writeText "prometheus-unpoller-exporter.json" (generators.toJSON {} { configFile = pkgs.writeText "prometheus-unpoller-exporter.json" (generators.toJSON {} {
poller = { inherit (cfg.log) debug quiet; }; poller = { inherit (cfg.log) debug quiet; };

View File

@ -1,9 +1,8 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.v2ray; cfg = config.services.prometheus.exporters.v2ray;
inherit (lib) mkOption types concatStringsSep;
in in
{ {
port = 9299; port = 9299;

View File

@ -1,9 +1,15 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.varnish; cfg = config.services.prometheus.exporters.varnish;
inherit (lib)
mkOption
types
mkDefault
optional
escapeShellArg
concatStringsSep
;
in in
{ {
port = 9131; port = 9131;

View File

@ -1,9 +1,15 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.wireguard; cfg = config.services.prometheus.exporters.wireguard;
inherit (lib)
mkOption
types
mkRenamedOptionModule
mkEnableOption
optionalString
escapeShellArg
;
in { in {
port = 9586; port = 9586;
imports = [ imports = [

View File

@ -1,9 +1,14 @@
{ config, lib, pkgs, options, ... }: { config, lib, pkgs, options, ... }:
with lib;
let let
cfg = config.services.prometheus.exporters.zfs; cfg = config.services.prometheus.exporters.zfs;
inherit (lib)
mkOption
types
concatStringsSep
concatMapStringsSep
;
in in
{ {
port = 9134; port = 9134;

View File

@ -907,7 +907,7 @@ let
attrs = { attrs = {
objectClass = [ "olcDatabaseConfig" "olcMdbConfig" ]; objectClass = [ "olcDatabaseConfig" "olcMdbConfig" ];
olcDatabase = "{1}mdb"; olcDatabase = "{1}mdb";
olcDbDirectory = "/var/db/openldap"; olcDbDirectory = "/var/lib/openldap/db";
olcSuffix = "dc=example"; olcSuffix = "dc=example";
olcRootDN = { olcRootDN = {
# cn=root,dc=example # cn=root,dc=example