treewide: with stdenv.lib; in meta -> with lib;

Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
This commit is contained in:
Profpatsch
2021-01-11 10:38:22 +01:00
parent e87aef06e0
commit 4a7f99d55d
6869 changed files with 13585 additions and 13580 deletions
@@ -1,4 +1,4 @@
{ stdenv, go, buildGoPackage, fetchFromGitHub, installShellFiles }:
{ lib, stdenv, go, buildGoPackage, fetchFromGitHub, installShellFiles }:
buildGoPackage rec {
pname = "alertmanager";
@@ -31,7 +31,7 @@ buildGoPackage rec {
installShellCompletion amtool.bash
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Alert dispatcher for the Prometheus monitoring system";
homepage = "https://github.com/prometheus/alertmanager";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
{ lib, stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "apcupsd-exporter";
@@ -17,7 +17,7 @@ buildGoModule rec {
passthru.tests = { inherit (nixosTests.prometheus-exporters) apcupsd; };
meta = with stdenv.lib; {
meta = with lib; {
description = "Provides a Prometheus exporter for the apcupsd Network Information Server (NIS)";
homepage = "https://github.com/mdlayher/apcupsd_exporter";
license = licenses.mit;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
pname = "aws-s3-exporter";
@@ -15,7 +15,7 @@ buildGoPackage rec {
doCheck = true;
meta = with stdenv.lib; {
meta = with lib; {
description = "Exports Prometheus metrics about S3 buckets and objects";
homepage = "https://github.com/ribbybibby/s3_exporter";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "bind_exporter";
@@ -16,7 +16,7 @@ buildGoPackage rec {
passthru.tests = { inherit (nixosTests.prometheus-exporters) bind; };
meta = with stdenv.lib; {
meta = with lib; {
description = "Prometheus exporter for bind9 server";
homepage = "https://github.com/digitalocean/bind_exporter";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
{ lib, stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "bird-exporter";
@@ -15,7 +15,7 @@ buildGoModule rec {
passthru.tests = { inherit (nixosTests.prometheus-exporters) bird; };
meta = with stdenv.lib; {
meta = with lib; {
description = "Prometheus exporter for the bird routing daemon";
homepage = "https://github.com/czerwonk/bird_exporter";
license = licenses.mit;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "blackbox_exporter";
@@ -19,7 +19,7 @@ buildGoPackage rec {
passthru.tests = { inherit (nixosTests.prometheus-exporters) blackbox; };
meta = with stdenv.lib; {
meta = with lib; {
description = "Blackbox probing of endpoints over HTTP, HTTPS, DNS, TCP and ICMP";
homepage = "https://github.com/prometheus/blackbox_exporter";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "collectd-exporter";
@@ -16,7 +16,7 @@ buildGoPackage rec {
passthru.tests = { inherit (nixosTests.prometheus-exporters) collectd; };
meta = with stdenv.lib; {
meta = with lib; {
description = "Relay server for exporting metrics from collectd to Prometheus";
homepage = "https://github.com/prometheus/collectd_exporter";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
pname = "consul_exporter";
@@ -13,7 +13,7 @@ buildGoPackage rec {
sha256 = "16ibafcbpiplsh1awcvblzzf2cbr4baf8wiwpdpibgmcwwf9m5ya";
};
meta = with stdenv.lib; {
meta = with lib; {
description = "Prometheus exporter for Consul metrics";
homepage = "https://github.com/prometheus/consul_exporter";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
{ lib, stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "dnsmasq_exporter";
@@ -17,7 +17,7 @@ buildGoModule rec {
passthru.tests = { inherit (nixosTests.prometheus-exporters) dnsmasq; };
meta = with stdenv.lib; {
meta = with lib; {
inherit (src.meta) homepage;
description = "A dnsmasq exporter for Prometheus";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "dovecot_exporter";
@@ -17,7 +17,7 @@ buildGoPackage rec {
passthru.tests = { inherit (nixosTests.prometheus-exporters) dovecot; };
meta = with stdenv.lib; {
meta = with lib; {
inherit (src.meta) homepage;
description = "Prometheus metrics exporter for Dovecot";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "fritzbox-exporter";
@@ -18,7 +18,7 @@ buildGoPackage rec {
passthru.tests = { inherit (nixosTests.prometheus-exporters) fritzbox; };
meta = with stdenv.lib; {
meta = with lib; {
description = "Prometheus Exporter for FRITZ!Box (TR64 and UPnP)";
homepage = "https://github.com/ndecker/fritzbox_exporter";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
pname = "gitlab-ci-pipelines-exporter";
@@ -17,7 +17,7 @@ buildGoPackage rec {
doCheck = true;
meta = with stdenv.lib; {
meta = with lib; {
description = "Prometheus / OpenMetrics exporter for GitLab CI pipelines insights";
homepage = "https://github.com/mvisonneau/gitlab-ci-pipelines-exporter";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
pname = "haproxy_exporter";
@@ -14,7 +14,7 @@ buildGoPackage rec {
sha256 = "0gx8pq67w71ch3g3c77xaz39msrd9graizc6d3shwabdjx35yc6q";
};
meta = with stdenv.lib; {
meta = with lib; {
description = "HAProxy Exporter for the Prometheus monitoring system";
homepage = "https://github.com/prometheus/haproxy_exporter";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, jre, makeWrapper }:
{ lib, stdenv, fetchurl, jre, makeWrapper }:
let
version = "0.10";
@@ -25,7 +25,7 @@ in stdenv.mkDerivation {
makeWrapper "${jre}/bin/java" $out/bin/jmx_prometheus_httpserver --add-flags "-jar $out/libexec/$jarName"
'';
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://github.com/prometheus/jmx_exporter";
description = "A process for exposing JMX Beans via HTTP for Prometheus consumption";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
{ lib, stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "keylight-exporter";
@@ -17,7 +17,7 @@ buildGoModule rec {
passthru.tests = { inherit (nixosTests.prometheus-exporters) keylight; };
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://github.com/mdlayher/keylight_exporter";
description = "Prometheus exporter for Elgato Key Light devices";
license = licenses.mit;
@@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
{ lib, stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "lndmon";
@@ -17,7 +17,7 @@ buildGoModule rec {
passthru.tests = { inherit (nixosTests.prometheus-exporters) lnd; };
meta = with stdenv.lib; {
meta = with lib; {
inherit (src.meta) homepage;
description = "Prometheus exporter for lnd (Lightning Network Daemon)";
license = licenses.mit;
@@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub, installShellFiles, nixosTests }:
{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles, nixosTests }:
buildGoModule {
pname = "mailexporter";
@@ -22,7 +22,7 @@ buildGoModule {
passthru.tests = { inherit (nixosTests.prometheus-exporters) mail; };
meta = with stdenv.lib; {
meta = with lib; {
description = "Export Prometheus-style metrics about mail server functionality";
homepage = "https://github.com/cherti/mailexporter";
license = licenses.gpl3;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
pname = "mesos_exporter";
@@ -16,7 +16,7 @@ buildGoPackage rec {
goDeps = ./mesos-exporter_deps.nix;
meta = with stdenv.lib; {
meta = with lib; {
description = "Export Mesos metrics to Prometheus";
homepage = "https://github.com/prometheus/mesos_exporter";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
{ lib, stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "mikrotik-exporter-unstable";
@@ -17,7 +17,7 @@ buildGoModule rec {
passthru.tests = { inherit (nixosTests.prometheus-exporters) mikrotik; };
meta = with stdenv.lib; {
meta = with lib; {
inherit (src.meta) homepage;
description = "Prometheus MikroTik device(s) exporter";
license = licenses.bsd3;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, fetchpatch }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub, fetchpatch }:
buildGoPackage rec {
pname = "minio-exporter";
@@ -25,7 +25,7 @@ buildGoPackage rec {
goDeps = ./deps.nix;
meta = with stdenv.lib; {
meta = with lib; {
description = "A Prometheus exporter for Minio cloud storage server";
homepage = "https://github.com/joe-pll/minio-exporter";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
{ lib, stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "modemmanager-exporter";
@@ -17,7 +17,7 @@ buildGoModule rec {
passthru.tests = { inherit (nixosTests.prometheus-exporters) modemmanager; };
meta = with stdenv.lib; {
meta = with lib; {
homepage = "https://github.com/mdlayher/modemmanager_exporter";
description = "Prometheus exporter for ModemManager and its devices";
license = licenses.mit;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
pname = "mysqld_exporter";
@@ -14,7 +14,7 @@ buildGoPackage rec {
sha256 = "0nzbfzx4dzs3cagdid1fqddrqimgr8x6r8gmmxglrss05c8srgs8";
};
meta = with stdenv.lib; {
meta = with lib; {
description = "Prometheus exporter for MySQL server metrics";
homepage = "https://github.com/prometheus/mysqld_exporter";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "nginx_exporter";
@@ -21,7 +21,7 @@ buildGoPackage rec {
passthru.tests = { inherit (nixosTests.prometheus-exporters) nginx; };
meta = with stdenv.lib; {
meta = with lib; {
description = "NGINX Prometheus Exporter for NGINX and NGINX Plus";
homepage = "https://github.com/nginxinc/nginx-prometheus-exporter";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
{ lib, stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "nginxlog_exporter";
@@ -19,7 +19,7 @@ buildGoModule rec {
passthru.tests = { inherit (nixosTests.prometheus-exporters) nginxlog; };
meta = with stdenv.lib; {
meta = with lib; {
description = "Export metrics from Nginx access log files to Prometheus";
homepage = "https://github.com/martin-helmich/prometheus-nginxlog-exporter";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "node_exporter";
@@ -25,7 +25,7 @@ buildGoPackage rec {
passthru.tests = { inherit (nixosTests.prometheus-exporters) node; };
meta = with stdenv.lib; {
meta = with lib; {
description = "Prometheus exporter for machine metrics";
homepage = "https://github.com/prometheus/node_exporter";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
pname = "openvpn_exporter-unstable";
@@ -16,7 +16,7 @@ buildGoPackage rec {
goDeps = ./openvpn-exporter-deps.nix;
meta = with stdenv.lib; {
meta = with lib; {
inherit (src.meta) homepage;
description = "Prometheus exporter for OpenVPN";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
pname = "process-exporter";
@@ -19,7 +19,7 @@ buildGoPackage rec {
doCheck = true;
meta = with stdenv.lib; {
meta = with lib; {
description = "Prometheus exporter that mines /proc to report on selected processes";
homepage = "https://github.com/ncabatoff/process-exporter";
license = licenses.mit;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
pname = "prom2json";
@@ -16,7 +16,7 @@ buildGoPackage rec {
goDeps = ./prom2json_deps.nix;
meta = with stdenv.lib; {
meta = with lib; {
description = "Tool to scrape a Prometheus client and dump the result as JSON";
homepage = "https://github.com/prometheus/prom2json";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv
{ lib, stdenv
, buildGoModule
, fetchFromGitHub
}:
@@ -20,7 +20,7 @@ buildGoModule rec {
doCheck = false; # Requires access to a docker daemon
meta = with stdenv.lib; {
meta = with lib; {
description = "An open-source analytical platform for Prometheus metrics";
homepage = "https://github.com/timescale/promscale";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, go, buildGoPackage, fetchFromGitHub }:
{ lib, stdenv, go, buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
pname = "pushgateway";
@@ -39,7 +39,7 @@ buildGoPackage rec {
done
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Allows ephemeral and batch jobs to expose metrics to Prometheus";
homepage = "https://github.com/prometheus/pushgateway";
license = licenses.asl20;
@@ -1,5 +1,5 @@
# This file was generated by https://github.com/kamilchm/go2nix v2.0-dev
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
buildGoPackage {
pname = "rabbitmq_exporter";
@@ -16,7 +16,7 @@ buildGoPackage {
goDeps = ./rabbitmq-exporter_deps.nix;
meta = with stdenv.lib; {
meta = with lib; {
description = "Prometheus exporter for RabbitMQ";
homepage = "https://github.com/kbudde/rabbitmq_exporter";
license = licenses.mit;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "redis_exporter";
@@ -24,7 +24,7 @@ buildGoPackage rec {
passthru.tests = { inherit (nixosTests.prometheus-exporters) redis; };
meta = with stdenv.lib; {
meta = with lib; {
description = "Prometheus exporter for Redis metrics";
inherit (src.meta) homepage;
license = licenses.mit;
@@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
{ lib, stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
let
inherit (stdenv) lib;
@@ -33,7 +33,7 @@ buildGoModule rec {
passthru.tests = { inherit (nixosTests.prometheus-exporters) smokeping; };
meta = with stdenv.lib; {
meta = with lib; {
description = "Prometheus exporter for sending continual ICMP/UDP pings";
homepage = "https://github.com/SuperQ/smokeping_prober";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, net-snmp, nixosTests }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub, net-snmp, nixosTests }:
buildGoPackage rec {
pname = "snmp_exporter";
@@ -19,7 +19,7 @@ buildGoPackage rec {
passthru.tests = { inherit (nixosTests.prometheus-exporters) snmp; };
meta = with stdenv.lib; {
meta = with lib; {
description = "SNMP Exporter for Prometheus";
homepage = "https://github.com/prometheus/snmp_exporter";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
{ lib, stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "sql_exporter";
@@ -13,7 +13,7 @@ buildGoModule rec {
sha256 = "125brlxgwhkn3z5v0522gpm0sk6v905ghh05c4c3wf1hlm7bhnrc";
};
meta = with stdenv.lib; {
meta = with lib; {
description = "Flexible SQL exporter for Prometheus";
homepage = "https://github.com/justwatchcom/sql_exporter";
license = licenses.mit;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
pname = "statsd_exporter";
@@ -14,7 +14,7 @@ buildGoPackage rec {
sha256 = "0bgi00005j41p650rb6n1iz2w9m4p22d1w91f2hwlh5bqxf55al3";
};
meta = with stdenv.lib; {
meta = with lib; {
description = "Receives StatsD-style metrics and exports them to Prometheus";
homepage = "https://github.com/prometheus/statsd_exporter";
license = licenses.asl20;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "surfboard_exporter";
@@ -15,7 +15,7 @@ buildGoPackage rec {
passthru.tests = { inherit (nixosTests.prometheus-exporters) surfboard; };
meta = with stdenv.lib; {
meta = with lib; {
description = "Arris Surfboard signal metrics exporter";
homepage = "https://github.com/ipstatic/surfboard_exporter";
license = licenses.mit;
@@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
pname = "unifi-exporter";
@@ -14,7 +14,7 @@ buildGoPackage rec {
sha256 = "08zqvwvdqnc301f8jfh7bdvc138szw6xszx884b2v8w2x38w3rmn";
};
meta = with stdenv.lib; {
meta = with lib; {
description = "Prometheus exporter that exposes metrics from a Ubiquiti UniFi Controller and UniFi devices";
homepage = "https://github.com/mdlayher/unifi_exporter";
license = licenses.mit;