From 11e522cb6ed4bcd0ad59006bfa52f3b79e3017c3 Mon Sep 17 00:00:00 2001 From: Kevin Cox Date: Sun, 27 Dec 2020 08:04:16 -0500 Subject: [PATCH 01/33] Revert "nix-gitignore: Optimise performance" --- pkgs/build-support/nix-gitignore/default.nix | 26 +++++++++----------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/pkgs/build-support/nix-gitignore/default.nix b/pkgs/build-support/nix-gitignore/default.nix index abfe67ea4304..5d7b945bf1b1 100644 --- a/pkgs/build-support/nix-gitignore/default.nix +++ b/pkgs/build-support/nix-gitignore/default.nix @@ -20,13 +20,14 @@ let in rec { # [["good/relative/source/file" true] ["bad.tmpfile" false]] -> root -> path filterPattern = patterns: root: - let - filters = map (pair: relPath: if match (head pair) relPath == null then true else last pair) patterns; - in - name: _type: - let - relPath = lib.removePrefix ((toString root) + "/") name; - in foldl' (acc: f: if acc == true then f relPath else acc) true filters; + (name: _type: + let + relPath = lib.removePrefix ((toString root) + "/") name; + matches = pair: (match (head pair) relPath) != null; + matched = map (pair: [(matches pair) (last pair)]) patterns; + in + last (last ([[true true]] ++ (filter head matched))) + ); # string -> [[regex bool]] gitignoreToPatterns = gitignore: @@ -90,9 +91,7 @@ in rec { (filter (l: !isList l && !isComment l) (split "\n" gitignore)); - gitignoreFilter = ign: let - patterns = gitignoreToPatterns ign; - in root: filterPattern patterns root; + gitignoreFilter = ign: root: filterPattern (gitignoreToPatterns ign) root; # string|[string|file] (→ [string|file] → [string]) -> string gitignoreCompileIgnore = file_str_patterns: root: @@ -101,10 +100,9 @@ in rec { str_patterns = map (onPath readFile) (lib.toList file_str_patterns); in concatStringsSep "\n" str_patterns; - gitignoreFilterPure = filter: patterns: root: let - compiledFilter = gitignoreCompileIgnore patterns root; - filterFn = gitignoreFilter compiledFilter; - in name: type: filterFn root name type && filter name type; + gitignoreFilterPure = filter: patterns: root: name: type: + gitignoreFilter (gitignoreCompileIgnore patterns root) root name type + && filter name type; # This is a very hacky way of programming this! # A better way would be to reuse existing filtering by making multiple gitignore functions per each root. From 9555996b1d272dcc8217cf96903da99a4313e16a Mon Sep 17 00:00:00 2001 From: oxalica Date: Fri, 1 Jan 2021 01:25:03 +0800 Subject: [PATCH 02/33] cargo-flamegraph: 0.3.0 -> 0.4.0 and clean up --- .../tools/cargo-flamegraph/default.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pkgs/development/tools/cargo-flamegraph/default.nix b/pkgs/development/tools/cargo-flamegraph/default.nix index feaa3c312f48..3bdbb086d1dd 100644 --- a/pkgs/development/tools/cargo-flamegraph/default.nix +++ b/pkgs/development/tools/cargo-flamegraph/default.nix @@ -1,19 +1,19 @@ -{ lib, stdenv, fetchFromGitHub, rustPlatform, makeWrapper, perf +{ lib, stdenv, fetchFromGitHub, rustPlatform, makeWrapper, perf, nix-update-script , Security }: rustPlatform.buildRustPackage rec { pname = "cargo-flamegraph"; - version = "0.3.0"; + version = "0.4.0"; src = fetchFromGitHub { owner = "flamegraph-rs"; repo = "flamegraph"; rev = "v${version}"; - sha256 = "0d6k2qr76p93na39j4zbcpc9kaswd806wrqhcwisqxdrcxrjbwhk"; + sha256 = "sha256-IpmvFUWNaFQ1ls7u625vvj1TnRYXR+X1mAGdBcwRFLk="; }; - cargoSha256 = "1qz4a1b58j3bv3akqvc3bcgvqq4bi8cbm3gzws6a52dz7ycrgq46"; + cargoSha256 = "sha256-2YHkEQZqjKEvg4h9kIVhqmgq+SMF1c3r8UbSQivZh7w="; nativeBuildInputs = lib.optionals stdenv.isLinux [ makeWrapper ]; buildInputs = lib.optionals stdenv.isDarwin [ @@ -22,11 +22,15 @@ rustPlatform.buildRustPackage rec { postFixup = lib.optionalString stdenv.isLinux '' wrapProgram $out/bin/cargo-flamegraph \ - --suffix PATH ':' ${perf}/bin + --set-default PERF ${perf}/bin/perf wrapProgram $out/bin/flamegraph \ - --suffix PATH ':' ${perf}/bin + --set-default PERF ${perf}/bin/perf ''; + passthru.updateScript = nix-update-script { + attrPath = pname; + }; + meta = with lib; { description = "Easy flamegraphs for Rust projects and everything else, without Perl or pipes <3"; homepage = "https://github.com/ferrous-systems/flamegraph"; From 49d63b570e195b45aa714eb531dff87cdd1d71c1 Mon Sep 17 00:00:00 2001 From: Matej Urbas Date: Fri, 1 Jan 2021 12:34:24 +0000 Subject: [PATCH 03/33] python3Packages.py-air-control-exporter: add passthru.tests This change adds integration tests to the py-air-control-exporter package. These tests verify that the exporter exports metrics correctly in an actual NixOS virtual machine. --- .../python-modules/py-air-control-exporter/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/py-air-control-exporter/default.nix b/pkgs/development/python-modules/py-air-control-exporter/default.nix index 0ec483c16f30..b5ffc1fc0a5d 100644 --- a/pkgs/development/python-modules/py-air-control-exporter/default.nix +++ b/pkgs/development/python-modules/py-air-control-exporter/default.nix @@ -1,5 +1,6 @@ -{ buildPythonPackage, fetchPypi, flask, isPy27, lib, prometheus_client -, py-air-control, pytestCheckHook, pytestcov, pytestrunner, setuptools_scm }: +{ buildPythonPackage, fetchPypi, flask, isPy27, lib, nixosTests +, prometheus_client, py-air-control, pytestCheckHook, pytestcov, pytestrunner +, setuptools_scm }: buildPythonPackage rec { pname = "py-air-control-exporter"; @@ -15,6 +16,8 @@ buildPythonPackage rec { checkInputs = [ pytestCheckHook pytestcov pytestrunner ]; propagatedBuildInputs = [ flask prometheus_client py-air-control ]; + passthru.tests = { inherit (nixosTests.prometheus-exporters) py-air-control; }; + meta = with lib; { description = "Exports Air Quality Metrics to Prometheus."; homepage = "https://github.com/urbas/py-air-control-exporter"; From 39aa3e4ae32ae93d9d89f2a283c23a0cf549e498 Mon Sep 17 00:00:00 2001 From: Luka Blaskovic Date: Sat, 2 Jan 2021 07:17:35 +0000 Subject: [PATCH 04/33] luajit_2_0: 2.0.5-2020-09-27 -> 2.0.5-2020-12-28 --- pkgs/development/interpreters/luajit/2.0.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/interpreters/luajit/2.0.nix b/pkgs/development/interpreters/luajit/2.0.nix index 22ad9aa05f42..ffc406a2a7a3 100644 --- a/pkgs/development/interpreters/luajit/2.0.nix +++ b/pkgs/development/interpreters/luajit/2.0.nix @@ -1,10 +1,10 @@ { self, callPackage, lib }: callPackage ./default.nix { inherit self; - version = "2.0.5-2020-09-27"; - rev = "e8ec6fe"; + version = "2.0.5-2020-12-28"; + rev = "56c04accf975bff2519c34721dccbbdb7b8e6963"; isStable = true; - sha256 = "0v7g216j0zrjp32nfjqqxzgxgvgbdx89h3x0djbqg3avsgxjwnbk"; + sha256 = "0mmx7dy843iqdpyxxdfks860np0311gg58gi4zczx10h62y6jacm"; extraMeta = { # this isn't precise but it at least stops the useless Hydra build platforms = with lib; filter (p: p != "aarch64-linux") (platforms.linux ++ platforms.darwin); From 94bd5c24caf829d47623d8cefd3a51c918c18212 Mon Sep 17 00:00:00 2001 From: Luka Blaskovic Date: Sat, 2 Jan 2021 07:18:48 +0000 Subject: [PATCH 05/33] luajit_2_1: 2.1.0-2020-09-30 -> 2.1.0-2020-12-28 --- pkgs/development/interpreters/luajit/2.1.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/interpreters/luajit/2.1.nix b/pkgs/development/interpreters/luajit/2.1.nix index 18b4d32574ab..7335ecd656ac 100644 --- a/pkgs/development/interpreters/luajit/2.1.nix +++ b/pkgs/development/interpreters/luajit/2.1.nix @@ -1,8 +1,8 @@ { self, callPackage }: callPackage ./default.nix { inherit self; - version = "2.1.0-2020-09-30"; - rev = "e9af1ab"; + version = "2.1.0-2020-12-28"; + rev = "65378759f38bb946e40f31799992434effd01bba"; isStable = false; - sha256 = "081vrr4snr1c38cscbq1a8barv7abc9czqqlm4qlbdksa8g32bbj"; + sha256 = "1h78gydlrmvkdrql4ra5a3xr78iiq12bfmny6kiq65v1jbk8f19g"; } From d539517f2b4e20973d2046ca16ed83d9bc5b34ae Mon Sep 17 00:00:00 2001 From: WilliButz Date: Fri, 1 Jan 2021 23:54:13 +0100 Subject: [PATCH 06/33] prometheus-json-exporter: unstable-2017-10-06 -> 0.2.0 --- .../monitoring/prometheus/json-exporter.nix | 26 ++-- .../prometheus/json-exporter_deps.nix | 111 ------------------ 2 files changed, 9 insertions(+), 128 deletions(-) delete mode 100644 pkgs/servers/monitoring/prometheus/json-exporter_deps.nix diff --git a/pkgs/servers/monitoring/prometheus/json-exporter.nix b/pkgs/servers/monitoring/prometheus/json-exporter.nix index afa610809318..796eb065e63c 100644 --- a/pkgs/servers/monitoring/prometheus/json-exporter.nix +++ b/pkgs/servers/monitoring/prometheus/json-exporter.nix @@ -1,31 +1,23 @@ -# This file was generated by go2nix. -{ buildGoPackage, fetchFromGitHub, fetchpatch, lib, nixosTests }: +{ lib, buildGoModule, fetchFromGitHub, nixosTests }: -buildGoPackage { +buildGoModule rec { pname = "prometheus-json-exporter"; - version = "unstable-2017-10-06"; - - goPackagePath = "github.com/kawamuray/prometheus-json-exporter"; + version = "0.2.0"; src = fetchFromGitHub { - owner = "kawamuray"; - repo = "prometheus-json-exporter"; - rev = "51e3dc02a30ab818bb73e5c98c3853231c2dbb5f"; - sha256 = "1v1p4zcqnb3d3rm55r695ydn61h6gz95f55cpa22hzw18dasahdh"; + owner = "prometheus-community"; + repo = "json_exporter"; + rev = "v${version}"; + sha256 = "1aabvd75a2223x5wnbyryigj7grw6l05jhr3g3s97b1f1hfigz6d"; }; - goDeps = ./json-exporter_deps.nix; - - patches = [(fetchpatch { # adds bool support - url = "https://patch-diff.githubusercontent.com/raw/kawamuray/prometheus-json-exporter/pull/17.patch"; - sha256 = "0mc5axhd2bykci41dgswl4r1552d70jsmb17lbih7czhsy6rgmrm"; - })]; + vendorSha256 = "03kb0gklq08krl7qnvs7267siw1pkyy346b42dsk1d9gr5302wsw"; passthru.tests = { inherit (nixosTests.prometheus-exporters) json; }; meta = with lib; { description = "A prometheus exporter which scrapes remote JSON by JSONPath"; - homepage = "https://github.com/kawamuray/prometheus-json-exporter"; + homepage = "https://github.com/prometheus-community/json_exporter"; license = licenses.asl20; maintainers = with maintainers; [ willibutz ]; }; diff --git a/pkgs/servers/monitoring/prometheus/json-exporter_deps.nix b/pkgs/servers/monitoring/prometheus/json-exporter_deps.nix deleted file mode 100644 index 9416125bc0c2..000000000000 --- a/pkgs/servers/monitoring/prometheus/json-exporter_deps.nix +++ /dev/null @@ -1,111 +0,0 @@ -# This file was generated by go2nix. -[ - { - goPackagePath = "github.com/Sirupsen/logrus"; - fetch = { - type = "git"; - url = "https://github.com/Sirupsen/logrus"; - rev = "a437dfd2463eaedbec3dfe443e477d3b0a810b3f"; - sha256 = "1904s2bbc7p88anzjp6fyj3jrbm5p6wbb8j4490674dq10kkcfbj"; - }; - } - { - goPackagePath = "github.com/beorn7/perks"; - fetch = { - type = "git"; - url = "https://github.com/beorn7/perks"; - rev = "4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9"; - sha256 = "1hrybsql68xw57brzj805xx2mghydpdiysv3gbhr7f5wlxj2514y"; - }; - } - { - goPackagePath = "github.com/golang/protobuf"; - fetch = { - type = "git"; - url = "https://github.com/golang/protobuf"; - rev = "8ee79997227bf9b34611aee7946ae64735e6fd93"; - sha256 = "0qm1lpdhf97k2hxgivq2cpjgawhlmmz39y230kgxijhm96xijxb8"; - }; - } - { - goPackagePath = "github.com/kawamuray/jsonpath"; - fetch = { - type = "git"; - url = "https://github.com/kawamuray/jsonpath"; - rev = "5c448ebf973557834ef870e788b0b2d95ac68d12"; - sha256 = "1i1id1i85rf09rldp03h0ibyi6zg0fz9p9l5qj7i8dfs6h6y8f0a"; - }; - } - { - goPackagePath = "github.com/kawamuray/prometheus-exporter-harness"; - fetch = { - type = "git"; - url = "https://github.com/kawamuray/prometheus-exporter-harness"; - rev = "97eeea7b8b0619ea2a065d75c0f0f5909327afa6"; - sha256 = "12al8irf8jb6p2xmm4wbh0wjqsyrdywynr4w122wxxnsx2n56xyv"; - }; - } - { - goPackagePath = "github.com/matttproud/golang_protobuf_extensions"; - fetch = { - type = "git"; - url = "https://github.com/matttproud/golang_protobuf_extensions"; - rev = "c12348ce28de40eed0136aa2b644d0ee0650e56c"; - sha256 = "1d0c1isd2lk9pnfq2nk0aih356j30k3h1gi2w0ixsivi5csl7jya"; - }; - } - { - goPackagePath = "github.com/prometheus/client_golang"; - fetch = { - type = "git"; - url = "https://github.com/prometheus/client_golang"; - rev = "575f371f7862609249a1be4c9145f429fe065e32"; - sha256 = "0hyvszjv5m6i40k2fn21c3bjr8jhlfdqavk1r6g2v5dybyj47vps"; - }; - } - { - goPackagePath = "github.com/prometheus/client_model"; - fetch = { - type = "git"; - url = "https://github.com/prometheus/client_model"; - rev = "fa8ad6fec33561be4280a8f0514318c79d7f6cb6"; - sha256 = "11a7v1fjzhhwsl128znjcf5v7v6129xjgkdpym2lial4lac1dhm9"; - }; - } - { - goPackagePath = "github.com/prometheus/common"; - fetch = { - type = "git"; - url = "https://github.com/prometheus/common"; - rev = "0d5de9d6d8629cb8bee6d4674da4127cd8b615a3"; - sha256 = "1zlvvgw67p66fz9nswkydq15j4a5z5kkiskl0jxps8i27ya1baq0"; - }; - } - { - goPackagePath = "github.com/prometheus/procfs"; - fetch = { - type = "git"; - url = "https://github.com/prometheus/procfs"; - rev = "abf152e5f3e97f2fafac028d2cc06c1feb87ffa5"; - sha256 = "0cp8lznv1b4zhi3wnbjkfxwzhkqd3wbmiy6mwgjanip8l9l3ykws"; - }; - } - { - goPackagePath = "github.com/urfave/cli"; - fetch = { - type = "git"; - url = "https://github.com/urfave/cli"; - rev = "0bdeddeeb0f650497d603c4ad7b20cfe685682f6"; - sha256 = "1ny63c7bfwfrsp7vfkvb4i0xhq4v7yxqnwxa52y4xlfxs4r6v6fg"; - }; - } - { - goPackagePath = "gopkg.in/yaml.v2"; - fetch = { - type = "git"; - url = "https://gopkg.in/yaml.v2"; - rev = "a5b47d31c556af34a302ce5d659e6fea44d90de0"; - sha256 = "0v6l48fshdjrqzyq1kwn22gy7vy434xdr1i0lm3prsf6jbln9fam"; - }; - } -] From 3f94c66ee121a2fdb136741c3685195c6d1db643 Mon Sep 17 00:00:00 2001 From: WilliButz Date: Fri, 1 Jan 2021 23:59:06 +0100 Subject: [PATCH 07/33] nixos/prometheus-json-exporter: update modules & tests, add release notes --- nixos/doc/manual/release-notes/rl-2103.xml | 26 ++++ .../monitoring/prometheus/exporters.nix | 2 - .../monitoring/prometheus/exporters/json.nix | 30 +++-- .../prometheus/exporters/rspamd.nix | 122 ++++++++++-------- nixos/tests/prometheus-exporters.nix | 15 ++- 5 files changed, 120 insertions(+), 75 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2103.xml b/nixos/doc/manual/release-notes/rl-2103.xml index 38262b508994..0475c365504e 100644 --- a/nixos/doc/manual/release-notes/rl-2103.xml +++ b/nixos/doc/manual/release-notes/rl-2103.xml @@ -295,6 +295,32 @@ Based on , existing installations will continue to work. + + + The prometheus json exporter is now managed by the prometheus community. Together with additional features + some backwards incompatibilities were introduced. + Most importantly the exporter no longer accepts a fixed command-line parameter to specify the URL of the + endpoint serving JSON. It now expects this URL to be passed as an URL parameter, when scraping the exporter's + /probe endpoint. + In the prometheus scrape configuration the scrape target might look like this: + + http://some.json-exporter.host:7979/probe?target=https://example.com/some/json/endpoint + + + + Existing configuration for the exporter needs to be updated, but can partially be re-used. + Documentation is available in the upstream repository and a small example for NixOS is available + in the corresponding NixOS test. + + + These changes also affect services.prometheus.exporters.rspamd, which is + just a preconfigured instance of the json exporter. + + + For more information, take a look at the + official documentation of the json_exporter. + + diff --git a/nixos/modules/services/monitoring/prometheus/exporters.nix b/nixos/modules/services/monitoring/prometheus/exporters.nix index fe9d1a659078..1fd85c66f843 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters.nix @@ -236,8 +236,6 @@ in services.prometheus.exporters.minio.minioAddress = mkDefault "http://localhost:9000"; services.prometheus.exporters.minio.minioAccessKey = mkDefault config.services.minio.accessKey; services.prometheus.exporters.minio.minioAccessSecret = mkDefault config.services.minio.secretKey; - })] ++ [(mkIf config.services.rspamd.enable { - services.prometheus.exporters.rspamd.url = mkDefault "http://localhost:11334/stat"; })] ++ [(mkIf config.services.prometheus.exporters.rtl_433.enable { hardware.rtl-sdr.enable = mkDefault true; })] ++ [(mkIf config.services.nginx.enable { diff --git a/nixos/modules/services/monitoring/prometheus/exporters/json.nix b/nixos/modules/services/monitoring/prometheus/exporters/json.nix index bd0026b55f72..24364aababd1 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters/json.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters/json.nix @@ -4,32 +4,42 @@ with lib; let cfg = config.services.prometheus.exporters.json; + in { port = 7979; extraOpts = { - url = mkOption { - type = types.str; - description = '' - URL to scrape JSON from. - ''; - }; configFile = mkOption { type = types.path; description = '' Path to configuration file. ''; }; - listenAddress = {}; # not used }; serviceOpts = { serviceConfig = { ExecStart = '' - ${pkgs.prometheus-json-exporter}/bin/prometheus-json-exporter \ - --port ${toString cfg.port} \ - ${cfg.url} ${escapeShellArg cfg.configFile} \ + ${pkgs.prometheus-json-exporter}/bin/json_exporter \ + --config.file ${escapeShellArg cfg.configFile} \ + --web.listen-address="${cfg.listenAddress}:${toString cfg.port}" \ ${concatStringsSep " \\\n " cfg.extraFlags} ''; }; }; + imports = [ + (mkRemovedOptionModule [ "url" ] '' + This option was removed. The URL of the endpoint serving JSON + must now be provided to the exporter by prometheus via the url + parameter target. + + In prometheus a scrape URL would look like this: + + http://some.json-exporter.host:7979/probe?target=https://example.com/some/json/endpoint + + + For more information, take a look at the + official documentation of the json_exporter. + '') + ({ options.warnings = options.warnings; options.assertions = options.assertions; }) + ]; } diff --git a/nixos/modules/services/monitoring/prometheus/exporters/rspamd.nix b/nixos/modules/services/monitoring/prometheus/exporters/rspamd.nix index 1f02ae207249..84e7ba3554b7 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters/rspamd.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters/rspamd.nix @@ -10,64 +10,55 @@ let echo '${builtins.toJSON conf}' | ${pkgs.buildPackages.jq}/bin/jq '.' > $out ''; - generateConfig = extraLabels: (map (path: { - name = "rspamd_${replaceStrings [ "." " " ] [ "_" "_" ] path}"; - path = "$.${path}"; - labels = extraLabels; - }) [ - "actions.'add header'" - "actions.'no action'" - "actions.'rewrite subject'" - "actions.'soft reject'" - "actions.greylist" - "actions.reject" - "bytes_allocated" - "chunks_allocated" - "chunks_freed" - "chunks_oversized" - "connections" - "control_connections" - "ham_count" - "learned" - "pools_allocated" - "pools_freed" - "read_only" - "scanned" - "shared_chunks_allocated" - "spam_count" - "total_learns" - ]) ++ [{ - name = "rspamd_statfiles"; - type = "object"; - path = "$.statfiles[*]"; - labels = recursiveUpdate { - symbol = "$.symbol"; - type = "$.type"; - } extraLabels; - values = { - revision = "$.revision"; - size = "$.size"; - total = "$.total"; - used = "$.used"; - languages = "$.languages"; - users = "$.users"; - }; - }]; + generateConfig = extraLabels: { + metrics = (map (path: { + name = "rspamd_${replaceStrings [ "." " " ] [ "_" "_" ] path}"; + path = "$.${path}"; + labels = extraLabels; + }) [ + "actions.'add header'" + "actions.'no action'" + "actions.'rewrite subject'" + "actions.'soft reject'" + "actions.greylist" + "actions.reject" + "bytes_allocated" + "chunks_allocated" + "chunks_freed" + "chunks_oversized" + "connections" + "control_connections" + "ham_count" + "learned" + "pools_allocated" + "pools_freed" + "read_only" + "scanned" + "shared_chunks_allocated" + "spam_count" + "total_learns" + ]) ++ [{ + name = "rspamd_statfiles"; + type = "object"; + path = "$.statfiles[*]"; + labels = recursiveUpdate { + symbol = "$.symbol"; + type = "$.type"; + } extraLabels; + values = { + revision = "$.revision"; + size = "$.size"; + total = "$.total"; + used = "$.used"; + languages = "$.languages"; + users = "$.users"; + }; + }]; + }; in { port = 7980; extraOpts = { - listenAddress = {}; # not used - - url = mkOption { - type = types.str; - description = '' - URL to the rspamd metrics endpoint. - Defaults to http://localhost:11334/stat when - is true. - ''; - }; - extraLabels = mkOption { type = types.attrsOf types.str; default = { @@ -84,9 +75,26 @@ in }; }; serviceOpts.serviceConfig.ExecStart = '' - ${pkgs.prometheus-json-exporter}/bin/prometheus-json-exporter \ - --port ${toString cfg.port} \ - ${cfg.url} ${prettyJSON (generateConfig cfg.extraLabels)} \ + ${pkgs.prometheus-json-exporter}/bin/json_exporter \ + --config.file ${prettyJSON (generateConfig cfg.extraLabels)} \ + --web.listen-address "${cfg.listenAddress}:${toString cfg.port}" \ ${concatStringsSep " \\\n " cfg.extraFlags} ''; + + imports = [ + (mkRemovedOptionModule [ "url" ] '' + This option was removed. The URL of the rspamd metrics endpoint + must now be provided to the exporter by prometheus via the url + parameter target. + + In prometheus a scrape URL would look like this: + + http://some.rspamd-exporter.host:7980/probe?target=http://some.rspamd.host:11334/stat + + + For more information, take a look at the + official documentation of the json_exporter. + '') + ({ options.warnings = options.warnings; options.assertions = options.assertions; }) + ]; } diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix index f611d961769a..8fcb0a7aa2c3 100644 --- a/nixos/tests/prometheus-exporters.nix +++ b/nixos/tests/prometheus-exporters.nix @@ -222,10 +222,11 @@ let exporterConfig = { enable = true; url = "http://localhost"; - configFile = pkgs.writeText "json-exporter-conf.json" (builtins.toJSON [{ - name = "json_test_metric"; - path = "$.test"; - }]); + configFile = pkgs.writeText "json-exporter-conf.json" (builtins.toJSON { + metrics = [ + { name = "json_test_metric"; path = "$.test"; } + ]; + }); }; metricProvider = { systemd.services.prometheus-json-exporter.after = [ "nginx.service" ]; @@ -241,7 +242,9 @@ let wait_for_open_port(80) wait_for_unit("prometheus-json-exporter.service") wait_for_open_port(7979) - succeed("curl -sSf localhost:7979/metrics | grep -q 'json_test_metric 1'") + succeed( + "curl -sSf 'localhost:7979/probe?target=http://localhost' | grep -q 'json_test_metric 1'" + ) ''; }; @@ -659,7 +662,7 @@ let wait_for_open_port(11334) wait_for_open_port(7980) wait_until_succeeds( - "curl -sSf localhost:7980/metrics | grep -q 'rspamd_scanned{host=\"rspamd\"} 0'" + "curl -sSf 'localhost:7980/probe?target=http://localhost:11334/stat' | grep -q 'rspamd_scanned{host=\"rspamd\"} 0'" ) ''; }; From a500ff1c51966cdc64e66e6f40233c8130eb2d9d Mon Sep 17 00:00:00 2001 From: 0x4A6F <0x4A6F@users.noreply.github.com> Date: Sat, 2 Jan 2021 15:15:09 +0000 Subject: [PATCH 08/33] dasel: 1.11.0 -> 1.12.0 Added - Add -c, --compact flag to remove pretty-print formatting from JSON output. - Defined storage.IndentOption(indent string) ReadWriteOption. - Defined storage.PrettyPrintOption(enabled bool) ReadWriteOption. Changed - Changed storage.Parser funcs to allow the passing of ...ReadWriteOption. --- pkgs/applications/misc/dasel/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/misc/dasel/default.nix b/pkgs/applications/misc/dasel/default.nix index 8853ff266a6a..7bb61a3addde 100644 --- a/pkgs/applications/misc/dasel/default.nix +++ b/pkgs/applications/misc/dasel/default.nix @@ -5,16 +5,16 @@ buildGoModule rec { pname = "dasel"; - version = "1.11.0"; + version = "1.12.0"; src = fetchFromGitHub { owner = "TomWright"; repo = pname; rev = "v${version}"; - sha256 = "1xyh41vb2rypajjzbysw6k8x39bna8j3fmxcqyjcrqs0dzx78nk3"; + sha256 = "69igz0Q7pT0f6PsbZWHcwUiTKRTTzj7r5E6E5ExUoJo="; }; - vendorSha256 = "1il1vnv0v97qh8f47md5i6qaac2k8par0pd0z7zqg67vxq6gim85"; + vendorSha256 = "BdX4DO77mIf/+aBdkNVFUzClsIml1UMcgvikDbbdgcY="; buildFlagsArray = '' -ldflags=-s -w -X github.com/tomwright/dasel/internal.Version=${version} From 9139eb5aeeb11cd3bce46f8c8a4984698331b56e Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sat, 2 Jan 2021 20:15:25 +0100 Subject: [PATCH 09/33] bowtie2: 2.3.5.1 -> 2.4.2 --- .../applications/science/biology/bowtie2/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/science/biology/bowtie2/default.nix b/pkgs/applications/science/biology/bowtie2/default.nix index dc818e2fb868..603e5892ff11 100644 --- a/pkgs/applications/science/biology/bowtie2/default.nix +++ b/pkgs/applications/science/biology/bowtie2/default.nix @@ -1,19 +1,19 @@ -{ stdenv, fetchFromGitHub, zlib, tbb, python, perl }: +{ stdenv, fetchFromGitHub, cmake, tbb, zlib }: stdenv.mkDerivation rec { pname = "bowtie2"; - version = "2.3.5.1"; + version = "2.4.2"; src = fetchFromGitHub { owner = "BenLangmead"; repo = pname; rev = "v${version}"; - sha256 = "1l1f0yhjqqvy4lpxfml1xwv7ayimwbpzazvp0281gb4jb5f5mr1a"; + sha256 = "11apzq7l1lk3yxw97g9dfr0gwnvfh58x6apifcblgd66gbip3y1y"; }; - buildInputs = [ zlib tbb python perl ]; + nativeBuildInputs = [ cmake ]; - installFlags = [ "prefix=$(out)" ]; + buildInputs = [ tbb zlib ]; meta = with stdenv.lib; { description = "An ultrafast and memory-efficient tool for aligning sequencing reads to long reference sequences"; @@ -21,6 +21,6 @@ stdenv.mkDerivation rec { homepage = "http://bowtie-bio.sf.net/bowtie2"; maintainers = with maintainers; [ rybern ]; platforms = platforms.all; - broken = stdenv.isAarch64; + broken = stdenv.isAarch64; # only x86 is supported }; } From 95d7fc753081f1eb1c4577e637c460ba8edb10ee Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Sat, 2 Jan 2021 22:26:17 -0300 Subject: [PATCH 10/33] cargo-wipe: init at 0.3.0 Signed-off-by: Otavio Salvador --- .../tools/rust/cargo-wipe/default.nix | 32 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 33 insertions(+) create mode 100644 pkgs/development/tools/rust/cargo-wipe/default.nix diff --git a/pkgs/development/tools/rust/cargo-wipe/default.nix b/pkgs/development/tools/rust/cargo-wipe/default.nix new file mode 100644 index 000000000000..1ad0fbbb4b01 --- /dev/null +++ b/pkgs/development/tools/rust/cargo-wipe/default.nix @@ -0,0 +1,32 @@ +{ stdenv +, rustPlatform +, fetchFromGitHub +, nix-update-script +}: + +rustPlatform.buildRustPackage rec { + pname = "cargo-wipe"; + version = "0.3.0"; + + src = fetchFromGitHub { + owner = "mihai-dinculescu"; + repo = "cargo-wipe"; + rev = "v${version}"; + sha256 = "1kwkifdp98zsinh7xcsz2va252wxbw73xlrv0r7h3m0bn51d52vw"; + }; + + cargoSha256 = "15snr1b1pybwcjzwddxybvry3jyllcmrp8dyfm9yiagks3wrcfb4"; + + passthru = { + updateScript = nix-update-script { + attrPath = pname; + }; + }; + + meta = with stdenv.lib; { + description = ''Cargo subcommand "wipe": recursively finds and optionally wipes all "target" or "node_modules" folders''; + homepage = "https://github.com/mihai-dinculescu/cargo-wipe"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ otavio ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 29ba8ed4c38b..f8687d71eb8d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10250,6 +10250,7 @@ in cargo-watch = callPackage ../development/tools/rust/cargo-watch { inherit (darwin.apple_sdk.frameworks) CoreServices; }; + cargo-wipe = callPackage ../development/tools/rust/cargo-wipe { }; cargo-xbuild = callPackage ../development/tools/rust/cargo-xbuild { }; cargo-generate = callPackage ../development/tools/rust/cargo-generate { inherit (darwin.apple_sdk.frameworks) Security; From 9f5e31e92681be0c770e3595dce447b06a99fe51 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Sun, 3 Jan 2021 10:05:20 +0100 Subject: [PATCH 11/33] pdns-recursor: 4.4.1 -> 4.4.2 --- pkgs/servers/dns/pdns-recursor/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/dns/pdns-recursor/default.nix b/pkgs/servers/dns/pdns-recursor/default.nix index 8257d4ef2525..f23aa6b02c17 100644 --- a/pkgs/servers/dns/pdns-recursor/default.nix +++ b/pkgs/servers/dns/pdns-recursor/default.nix @@ -8,11 +8,11 @@ with stdenv.lib; stdenv.mkDerivation rec { pname = "pdns-recursor"; - version = "4.4.1"; + version = "4.4.2"; src = fetchurl { url = "https://downloads.powerdns.com/releases/pdns-recursor-${version}.tar.bz2"; - sha256 = "162nczipxnsbgg7clap697yikxjz1vdsjkaxxsn6hb6l6m3a6zzr"; + sha256 = "1kzmliim2pwh04y3y6bpai9fm0qmdicrmff09fv5h5wahi4pzfdh"; }; nativeBuildInputs = [ pkgconfig ]; From 244503020cb078f7af3ffcd0f13f6ba5b59e1827 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Sun, 3 Jan 2021 13:46:14 +1000 Subject: [PATCH 12/33] megatools: use wrapGAppsNoGuiHook The gui packages pulled in by wrapGAppsHook aren't needed as it's a cli tool. --- pkgs/tools/networking/megatools/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/networking/megatools/default.nix b/pkgs/tools/networking/megatools/default.nix index 43bbc62be954..2a957c8a3f41 100644 --- a/pkgs/tools/networking/megatools/default.nix +++ b/pkgs/tools/networking/megatools/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchgit, autoreconfHook, pkg-config, glib, fuse, curl, glib-networking -, asciidoc, libxml2, docbook_xsl, docbook_xml_dtd_45, libxslt, wrapGAppsHook }: +, asciidoc, libxml2, docbook_xsl, docbook_xml_dtd_45, libxslt, wrapGAppsNoGuiHook }: stdenv.mkDerivation rec { pname = "megatools"; @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ - autoreconfHook pkg-config wrapGAppsHook asciidoc libxml2 + autoreconfHook pkg-config wrapGAppsNoGuiHook asciidoc libxml2 docbook_xsl docbook_xml_dtd_45 libxslt ]; buildInputs = [ glib glib-networking curl ] From 680a8e7cd8f87b3fb42bafc6719675bccedc4657 Mon Sep 17 00:00:00 2001 From: Matt Layher Date: Sun, 3 Jan 2021 07:02:30 -0500 Subject: [PATCH 13/33] corerad: 0.2.8 -> 0.3.0 Signed-off-by: Matt Layher --- pkgs/tools/networking/corerad/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/networking/corerad/default.nix b/pkgs/tools/networking/corerad/default.nix index 38331163c122..6ac3c48100e8 100644 --- a/pkgs/tools/networking/corerad/default.nix +++ b/pkgs/tools/networking/corerad/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "corerad"; - version = "0.2.8"; + version = "0.3.0"; src = fetchFromGitHub { owner = "mdlayher"; repo = "corerad"; rev = "v${version}"; - sha256 = "053rihi8lqai3z837ddi441yl41lsg1zj9gl62s9vbjmq5l11fjh"; + sha256 = "1q4wcliifas8xvwy7kcq4fbc1iv7dha3k6j1nbwl7pjqmyggs3f4"; }; - vendorSha256 = "1ra4yfplmgzxzs1nlbm0izg339fjnkfrw071y8w4m6q6wnzdhljb"; + vendorSha256 = "07khxs15z9xzcmp4gyggdwqyz361y96h6ib92qax8k83cr0l494p"; doCheck = false; From 7a4aa780ca297b3a563c158045745da9a6b49809 Mon Sep 17 00:00:00 2001 From: Rouven Czerwinski Date: Sun, 3 Jan 2021 13:05:06 +0100 Subject: [PATCH 14/33] python3Packages.xmodem: 0.4.5 -> 0.4.6 Version bump. --- pkgs/development/python-modules/xmodem/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/xmodem/default.nix b/pkgs/development/python-modules/xmodem/default.nix index 48d658ba49b9..7e0a25709fb4 100644 --- a/pkgs/development/python-modules/xmodem/default.nix +++ b/pkgs/development/python-modules/xmodem/default.nix @@ -2,13 +2,13 @@ buildPythonPackage rec { pname = "xmodem"; - version = "0.4.5"; + version = "0.4.6"; src = fetchFromGitHub { owner = "tehmaze"; repo = "xmodem"; rev = version; - sha256 = "0nz2gxwaq3ys1knpw6zlz3xrc3ziambcirg3fmp3nvzjdq8ma3h0"; + sha256 = "1xx7wd8bnswxa1fv3bfim2gcamii79k7qmwg7dbxbjvrhbcjjc0l"; }; checkInputs = [ pytest which lrzsz ]; From 907e95015cd97f8de127a348ce74454ac5823065 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Sun, 3 Jan 2021 12:24:23 +1000 Subject: [PATCH 15/33] youtube-dl: 2020.12.31 -> 2021.01.03 https://github.com/ytdl-org/youtube-dl/releases/tag/2021.01.03 --- pkgs/tools/misc/youtube-dl/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/youtube-dl/default.nix b/pkgs/tools/misc/youtube-dl/default.nix index c407637599d2..0593e935599d 100644 --- a/pkgs/tools/misc/youtube-dl/default.nix +++ b/pkgs/tools/misc/youtube-dl/default.nix @@ -18,11 +18,11 @@ buildPythonPackage rec { # The websites youtube-dl deals with are a very moving target. That means that # downloads break constantly. Because of that, updates should always be backported # to the latest stable release. - version = "2020.12.31"; + version = "2021.01.03"; src = fetchurl { url = "https://yt-dl.org/downloads/${version}/${pname}-${version}.tar.gz"; - sha256 = "0ncqkzzaasda2hd89psgc0j34r2jinn1dcsfcapzrsd902qghkh9"; + sha256 = "0qqixcr748nfhnihkjzayzdja26kgrsds45q5s8krmfm3b79ipli"; }; nativeBuildInputs = [ installShellFiles makeWrapper ]; From 9e4f214de36f50f294422247f9f1a582cbcfe6a2 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 3 Jan 2021 14:00:47 +0100 Subject: [PATCH 16/33] python3Packages.aiomultiprocess: init at 0.8.0 --- .../aiomultiprocess/default.nix | 36 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/development/python-modules/aiomultiprocess/default.nix diff --git a/pkgs/development/python-modules/aiomultiprocess/default.nix b/pkgs/development/python-modules/aiomultiprocess/default.nix new file mode 100644 index 000000000000..9b648d595379 --- /dev/null +++ b/pkgs/development/python-modules/aiomultiprocess/default.nix @@ -0,0 +1,36 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "aiomultiprocess"; + version = "0.8.0"; + + src = fetchFromGitHub { + owner = "omnilib"; + repo = pname; + rev = "v${version}"; + sha256 = "0vkj1vgvlv828pi3sn0hjzdy9f0j63gljs2ylibbsaixa7mbkpvy"; + }; + + checkInputs = [ pytestCheckHook ]; + + pytestFlagsArray = [ "aiomultiprocess/tests/*.py" ]; + pythonImportsCheck = [ "aiomultiprocess" ]; + + meta = with lib; { + description = "Python module to improve performance"; + longDescription = '' + aiomultiprocess presents a simple interface, while running a full + AsyncIO event loop on each child process, enabling levels of + concurrency never before seen in a Python application. Each child + process can execute multiple coroutines at once, limited only by + the workload and number of cores available. + ''; + homepage = "https://github.com/omnilib/aiomultiprocess"; + license = with licenses; [ mit ]; + maintainers = [ maintainers.fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index cfb9ac52ccb1..4e48b424947e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -237,6 +237,8 @@ in { aiolifx-effects = callPackage ../development/python-modules/aiolifx-effects { }; + aiomultiprocess = callPackage ../development/python-modules/aiomultiprocess { }; + aiomysql = callPackage ../development/python-modules/aiomysql { }; aionotify = callPackage ../development/python-modules/aionotify { }; From beef4b95a9664b713e9107641a006cf627ae4c26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Bla=C5=A1kovi=C4=87?= Date: Sun, 3 Jan 2021 14:03:30 +0100 Subject: [PATCH 17/33] buildLuaPackage: pass propagatedBuildInputs to final derivation (#108311) propagatedBuildInputs was completely overridden in the process --- pkgs/development/lua-modules/generic/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/development/lua-modules/generic/default.nix b/pkgs/development/lua-modules/generic/default.nix index 71e1f7c05e6e..de21d3d6a3e6 100644 --- a/pkgs/development/lua-modules/generic/default.nix +++ b/pkgs/development/lua-modules/generic/default.nix @@ -1,11 +1,14 @@ { lua, writeText, toLuaModule }: -{ disabled ? false, ... } @ attrs: +{ disabled ? false +, propagatedBuildInputs ? [ ] +, ... +} @ attrs: if disabled then throw "${attrs.name} not supported by interpreter lua-${lua.luaversion}" else - toLuaModule( lua.stdenv.mkDerivation ( + toLuaModule (lua.stdenv.mkDerivation ( { makeFlags = [ "PREFIX=$(out)" @@ -18,8 +21,8 @@ else // { name = "lua${lua.luaversion}-" + attrs.name; - propagatedBuildInputs = [ + propagatedBuildInputs = propagatedBuildInputs ++ [ lua # propagate it for its setup-hook ]; } - ) ) + )) From 7964c9827f7ade5bc0a76e60fb364dfb72b5468e Mon Sep 17 00:00:00 2001 From: "EEva (JPotier)" Date: Sun, 3 Jan 2021 08:50:56 +0200 Subject: [PATCH 18/33] vcv-rack: fetch pffft from upstream project website instead of bitbucket MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Starting from this commit https://github.com/VCVRack/Rack/commit/2db08f15a00f6792bb3a45db31dd13f94966beed the upstream project does not expect to use bitbucket anymore. The title mentions that “BitBucket deleted all Mercurial repos”. Instead, an archive of the pffft source is hosted on vcvrack.com directly. The unziped sha256 is the same as before this change. --- pkgs/applications/audio/vcv-rack/default.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/audio/vcv-rack/default.nix b/pkgs/applications/audio/vcv-rack/default.nix index 18d8f7415b56..a94cfd3a7cc3 100644 --- a/pkgs/applications/audio/vcv-rack/default.nix +++ b/pkgs/applications/audio/vcv-rack/default.nix @@ -1,4 +1,4 @@ -{ stdenv, makeWrapper, fetchFromBitbucket, fetchFromGitHub, pkgconfig +{ stdenv, makeWrapper, fetchzip, fetchFromGitHub, pkgconfig , alsaLib, curl, glew, glfw, gtk2-x11, jansson, libjack2, libXext, libXi , libzip, rtaudio, rtmidi, speex, libsamplerate }: @@ -7,10 +7,8 @@ let # Others are downloaded with `make deps`. Due to previous issues with the # `glfw` submodule (see above) and because we can not access the network when # building in a sandbox, we fetch the dependency source manually. - pfft-source = fetchFromBitbucket { - owner = "jpommier"; - repo = "pffft"; - rev = "74d7261be17cf659d5930d4830609406bd7553e3"; + pfft-source = fetchzip { + url = "https://vcvrack.com/downloads/dep/pffft.zip"; sha256 = "084csgqa6f1a270bhybjayrh3mpyi2jimc87qkdgsqcp8ycsx1l1"; }; nanovg-source = fetchFromGitHub { From 8c46ea4ab53231999dc03eb73583c55db1d844f0 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sun, 3 Jan 2021 14:13:33 +0100 Subject: [PATCH 19/33] pinnwand: use poetry-core instead of poetry to reduce build-time closure --- pkgs/servers/pinnwand/default.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/pinnwand/default.nix b/pkgs/servers/pinnwand/default.nix index fd02fc770813..31417989c447 100644 --- a/pkgs/servers/pinnwand/default.nix +++ b/pkgs/servers/pinnwand/default.nix @@ -1,4 +1,4 @@ -{ lib, python3, fetchFromGitHub, nixosTests }: +{ lib, python3, fetchFromGitHub, nixosTests, fetchpatch }: let python = python3.override { @@ -25,7 +25,7 @@ in with python.pkgs; buildPythonApplication rec { }; nativeBuildInputs = [ - poetry + poetry-core ]; propagatedBuildInputs = [ @@ -43,6 +43,14 @@ in with python.pkgs; buildPythonApplication rec { pytest ''; + patches = [ + # Use poetry-core instead of poetry. Fixed in 1.2.3 + (fetchpatch { + url = "https://github.com/supakeen/pinnwand/commit/38ff5729c59abb97e4b416d3ca66466528b0eac7.patch"; + sha256 = "F3cZe29z/7glmS3KWzcfmZnhYmC0LrLLS0zHk7WS2rQ="; + }) + ]; + passthru.tests = nixosTests.pinnwand; meta = with lib; { From 3488d7ba1f8e41071c8e06b4a73711dad25b75af Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Sun, 3 Jan 2021 10:15:34 +0100 Subject: [PATCH 20/33] bdf2psf: 1.999 -> 1.200 --- pkgs/tools/misc/bdf2psf/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/bdf2psf/default.nix b/pkgs/tools/misc/bdf2psf/default.nix index 676467c9b67d..d7faaf460203 100644 --- a/pkgs/tools/misc/bdf2psf/default.nix +++ b/pkgs/tools/misc/bdf2psf/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "bdf2psf"; - version = "1.199"; + version = "1.200"; src = fetchurl { url = "mirror://debian/pool/main/c/console-setup/bdf2psf_${version}_all.deb"; - sha256 = "0qs0qrdagvnh4z20wp4v3v4ry6j5jihlpv3iqzzhdzzxjfrw9m9y"; + sha256 = "07z686h2fv9b3446fcym0sfzxwgkm9cc4bd3zhpv6j8bdfadnjxw"; }; nativeBuildInputs = [ dpkg ]; From 97e080a689e54d3c731b931fdc381b28c3601982 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 3 Jan 2021 15:13:05 +0100 Subject: [PATCH 21/33] python3Packages.sqlmap: 1.4.11 -> 1.4.12 --- pkgs/development/python-modules/sqlmap/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/sqlmap/default.nix b/pkgs/development/python-modules/sqlmap/default.nix index fe17c909efac..940dbdab9894 100644 --- a/pkgs/development/python-modules/sqlmap/default.nix +++ b/pkgs/development/python-modules/sqlmap/default.nix @@ -7,11 +7,11 @@ buildPythonPackage rec { pname = "sqlmap"; - version = "1.4.11"; + version = "1.4.12"; src = fetchPypi { inherit pname version; - sha256 = "5c91d13f090c8e891201c7b924cc2b2feccf12042b42075a5623b4986b9c9ee7"; + sha256 = "166adazdrv92azx4p0qng0cm3va6i301vfsr4yyf0azj3sdg0waj"; }; postPatch = '' @@ -26,6 +26,8 @@ buildPythonPackage rec { # No tests in archive doCheck = false; + pythonImportsCheck = [ "sqlmap" ]; + meta = with lib; { homepage = "http://sqlmap.org"; license = licenses.gpl2; From dc5d3bec158cd2213d528ee2684e63e5f18d6a4d Mon Sep 17 00:00:00 2001 From: Gauvain 'GovanifY' Roussel-Tarbouriech Date: Wed, 16 Dec 2020 14:03:06 +0100 Subject: [PATCH 22/33] vimPlugins.vim-DetectSpellLang: init at 2020-01-13 --- pkgs/misc/vim-plugins/generated.nix | 12 ++++++++++++ pkgs/misc/vim-plugins/vim-plugin-names | 1 + 2 files changed, 13 insertions(+) diff --git a/pkgs/misc/vim-plugins/generated.nix b/pkgs/misc/vim-plugins/generated.nix index 0b30d6239a6f..065388627997 100644 --- a/pkgs/misc/vim-plugins/generated.nix +++ b/pkgs/misc/vim-plugins/generated.nix @@ -4681,6 +4681,18 @@ let meta.homepage = "https://github.com/sunaku/vim-dasht/"; }; + vim-DetectSpellLang = buildVimPluginFrom2Nix { + pname = "vim-DetectSpellLang"; + version = "2020-01-13"; + src = fetchFromGitHub { + owner = "konfekt"; + repo = "vim-DetectSpellLang"; + rev = "d8b545ef138a9ff013f8243f85c79b277b26f5e1"; + sha256 = "0c1bxryw4rg4cyql7vfp2gwhkl2d0b8inc6shmgfy7jg4svhzs0w"; + }; + meta.homepage = "https://github.com/Konfekt/vim-DetectSpellLang/"; + }; + vim-devicons = buildVimPluginFrom2Nix { pname = "vim-devicons"; version = "2020-12-10"; diff --git a/pkgs/misc/vim-plugins/vim-plugin-names b/pkgs/misc/vim-plugins/vim-plugin-names index 95f341e16063..e0e8f080c0fd 100644 --- a/pkgs/misc/vim-plugins/vim-plugin-names +++ b/pkgs/misc/vim-plugins/vim-plugin-names @@ -245,6 +245,7 @@ keith/swift.vim kien/rainbow_parentheses.vim knubie/vim-kitty-navigator konfekt/fastfold +konfekt/vim-DetectSpellLang kristijanhusak/defx-git kristijanhusak/defx-icons kristijanhusak/deoplete-phpactor From 018072ea221254a449d11e45acba0f4b1f688c9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20P=C3=A4ssler?= Date: Sun, 3 Jan 2021 15:30:08 +0100 Subject: [PATCH 23/33] nixos/pam: use pam_faillock instead of pam_tally Fixes #108313 \#107185 removed pam_tally, in favor of pam_faillock (see release notes). --- nixos/modules/security/pam.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/security/pam.nix b/nixos/modules/security/pam.nix index a428103eaa96..1522111dbddf 100644 --- a/nixos/modules/security/pam.nix +++ b/nixos/modules/security/pam.nix @@ -394,7 +394,7 @@ let ${optionalString cfg.requireWheel "auth required pam_wheel.so use_uid"} ${optionalString cfg.logFailures - "auth required pam_tally.so"} + "auth required pam_faillock.so"} ${optionalString (config.security.pam.enableSSHAgentAuth && cfg.sshAgentAuth) "auth sufficient ${pkgs.pam_ssh_agent_auth}/libexec/pam_ssh_agent_auth.so file=${lib.concatStringsSep ":" config.services.openssh.authorizedKeysFiles}"} ${optionalString cfg.fprintAuth From 12f3e2c42cd7ece1dfb90ee96119d1db548dc734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20P=C3=A4ssler?= Date: Sun, 3 Jan 2021 13:53:34 +0100 Subject: [PATCH 24/33] nixos/tests/shadow: add switch user subtest --- nixos/tests/shadow.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nixos/tests/shadow.nix b/nixos/tests/shadow.nix index 0cc1d6811400..8f8cdef7ef9d 100644 --- a/nixos/tests/shadow.nix +++ b/nixos/tests/shadow.nix @@ -2,6 +2,7 @@ let password1 = "foobar"; password2 = "helloworld"; password3 = "bazqux"; + password4 = "asdf123"; in import ./make-test-python.nix ({ pkgs, ... }: { name = "shadow"; meta = with pkgs.stdenv.lib.maintainers; { maintainers = [ nequissimus ]; }; @@ -19,6 +20,10 @@ in import ./make-test-python.nix ({ pkgs, ... }: { password = password2; shell = pkgs.shadow; }; + users.ash = { + password = password4; + shell = pkgs.bash; + }; }; }; @@ -41,6 +46,15 @@ in import ./make-test-python.nix ({ pkgs, ... }: { shadow.wait_for_file("/tmp/1") assert "emma" in shadow.succeed("cat /tmp/1") + with subtest("Switch user"): + shadow.send_chars("su - ash\n") + shadow.sleep(2) + shadow.send_chars("${password4}\n") + shadow.sleep(2) + shadow.send_chars("whoami > /tmp/3\n") + shadow.wait_for_file("/tmp/3") + assert "ash" in shadow.succeed("cat /tmp/3") + with subtest("Change password"): shadow.send_key("alt-f3") shadow.wait_until_succeeds(f"[ $(fgconsole) = 3 ]") From a001d45ac2653eefe269ea3fbf9650ed2e2a25e3 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sun, 3 Jan 2021 15:50:37 +0100 Subject: [PATCH 25/33] pam.passthru.tests: add relevant nixos tests --- pkgs/os-specific/linux/pam/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/pam/default.nix b/pkgs/os-specific/linux/pam/default.nix index e6fbc9aa0975..3faf74af6408 100644 --- a/pkgs/os-specific/linux/pam/default.nix +++ b/pkgs/os-specific/linux/pam/default.nix @@ -1,4 +1,6 @@ -{ stdenv, buildPackages, fetchurl, fetchpatch, flex, cracklib, db4 }: +{ stdenv, buildPackages, fetchurl, fetchpatch, flex, cracklib, db4 +, nixosTests +}: stdenv.mkDerivation rec { pname = "linux-pam"; @@ -63,6 +65,10 @@ stdenv.mkDerivation rec { doCheck = false; # fails + passthru.tests = { + inherit (nixosTests) pam-oath-login pam-u2f shadow; + }; + meta = with stdenv.lib; { homepage = "http://www.linux-pam.org/"; description = "Pluggable Authentication Modules, a flexible mechanism for authenticating user"; From d35b77a922e07090832647bbc5530263309c2144 Mon Sep 17 00:00:00 2001 From: Bryan Gardiner Date: Sun, 3 Jan 2021 05:34:37 -0800 Subject: [PATCH 26/33] gramps: move intltool from buildInputs to nativeBuildInputs When intltool is in buildInputs, setup.py reports: No intltool or version < 0.25.0, build_intl is aborting which prevents Gramps's desktop and MIME (and AppData) entries from being generated and installed. When intltool is moved to nativeBuildInputs, these files are installed under share/ as expected. --- pkgs/applications/misc/gramps/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/gramps/default.nix b/pkgs/applications/misc/gramps/default.nix index 1ef00efaf7b4..6d28abb737f5 100644 --- a/pkgs/applications/misc/gramps/default.nix +++ b/pkgs/applications/misc/gramps/default.nix @@ -12,8 +12,8 @@ in buildPythonApplication rec { version = "5.1.3"; pname = "gramps"; - nativeBuildInputs = [ wrapGAppsHook gettext ]; - buildInputs = [ intltool gtk3 gobject-introspection pango gexiv2 ] + nativeBuildInputs = [ wrapGAppsHook intltool gettext ]; + buildInputs = [ gtk3 gobject-introspection pango gexiv2 ] # Map support ++ stdenv.lib.optional enableOSM osm-gps-map # Graphviz support From 699b3ce797cc61c0e4153aef00f982b5b21bd1df Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Sun, 3 Jan 2021 12:16:03 -0300 Subject: [PATCH 27/33] pythonPackages.denonavr: 0.9.9 -> 0.9.10 --- pkgs/development/python-modules/denonavr/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/denonavr/default.nix b/pkgs/development/python-modules/denonavr/default.nix index 3d047213f7f5..b02e1e498b9d 100644 --- a/pkgs/development/python-modules/denonavr/default.nix +++ b/pkgs/development/python-modules/denonavr/default.nix @@ -3,14 +3,14 @@ buildPythonPackage rec { pname = "denonavr"; - version = "0.9.9"; + version = "0.9.10"; disabled = isPy27; src = fetchFromGitHub { owner = "scarface-4711"; repo = "denonavr"; rev = version; - sha256 = "08zh8rdadmxcgr707if6g5k5j2xz21s6jrn4kxh1c7xqpgdfggd9"; + sha256 = "sha256-3ap8F3ayBTpaR98md+gT0+hkIWlFBNxStTGWT5AL//A="; }; propagatedBuildInputs = [ From 418f4e11d63258593dc49b1927d86ea2e4354dc6 Mon Sep 17 00:00:00 2001 From: 06kellyjac Date: Sun, 3 Jan 2021 15:26:03 +0000 Subject: [PATCH 28/33] tokei: 12.0.4 -> 12.1.1 --- pkgs/development/tools/misc/tokei/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/misc/tokei/default.nix b/pkgs/development/tools/misc/tokei/default.nix index baf14b933dcb..0c366668c5c4 100644 --- a/pkgs/development/tools/misc/tokei/default.nix +++ b/pkgs/development/tools/misc/tokei/default.nix @@ -2,16 +2,16 @@ rustPlatform.buildRustPackage rec { pname = "tokei"; - version = "12.0.4"; + version = "12.1.1"; src = fetchFromGitHub { owner = "XAMPPRocky"; repo = pname; rev = "v${version}"; - sha256 = "0vj6xpp5ss82n1zxljy5893s8l1pdhar5xqay5vvglkp8bzblin6"; + sha256 = "1n5n7lxlw6zhrdf4jbmqpyn9k02dpn4wqm93qgiin4i8j8bxwjw8"; }; - cargoSha256 = "02c2pdjzd49qznm1yj3rnli48267ajjdklrb1cpj0rhpirw4rh1j"; + cargoSha256 = "0bph6n8i5dfy5ryr3nyd3pxyrl1032vvg63s4s44g01qjm9rfdvf"; buildInputs = stdenv.lib.optionals stdenv.isDarwin [ libiconv darwin.apple_sdk.frameworks.Security From 287939e2eddcc79c9cb87b9865f207382e810350 Mon Sep 17 00:00:00 2001 From: Phillip Cloud Date: Tue, 29 Dec 2020 11:53:17 -0500 Subject: [PATCH 29/33] nixos/prometheus: update relabel_action list --- nixos/modules/services/monitoring/prometheus/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/monitoring/prometheus/default.nix b/nixos/modules/services/monitoring/prometheus/default.nix index 19741b46f24e..4f9be38f7f14 100644 --- a/nixos/modules/services/monitoring/prometheus/default.nix +++ b/nixos/modules/services/monitoring/prometheus/default.nix @@ -585,10 +585,10 @@ let regular expression matches. ''; - action = mkDefOpt (types.enum ["replace" "keep" "drop"]) "replace" '' + action = + mkDefOpt (types.enum ["replace" "keep" "drop" "hashmod" "labelmap" "labeldrop" "labelkeep"]) "replace" '' Action to perform based on regex matching. ''; - }; }; From ebced7f8c13d102b78ff6eacc624cbaadb913a61 Mon Sep 17 00:00:00 2001 From: Ben Siraphob Date: Thu, 29 Oct 2020 11:04:13 +0700 Subject: [PATCH 30/33] z88dk: 2020-01-27 -> 2.0 --- pkgs/development/compilers/z88dk/default.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/development/compilers/z88dk/default.nix b/pkgs/development/compilers/z88dk/default.nix index 890924dddc12..0fb73d42b7e2 100644 --- a/pkgs/development/compilers/z88dk/default.nix +++ b/pkgs/development/compilers/z88dk/default.nix @@ -1,14 +1,14 @@ { fetchFromGitHub, stdenv, makeWrapper, unzip, libxml2, m4, uthash, which }: stdenv.mkDerivation rec { - pname = "z88dk-unstable"; - version = "2020-01-27"; + pname = "z88dk"; + version = "2.0"; src = fetchFromGitHub { owner = "z88dk"; - repo = "z88dk"; - rev = "efdd07c2e2229cac7cfef97ec01f478004846e39"; - sha256 = "0jcks5ygp256lmzmllffp4yb38cxjgdyqnnimkj4s65095cfasyb"; + repo = "z88dk"; + rev = "v${version}"; + sha256 = "14r9bjw6lgz85a59a4ajspvg12swiqxi17zicl8r7p29pi9lsibp"; fetchSubmodules = true; }; @@ -50,10 +50,10 @@ stdenv.mkDerivation rec { installTargets = [ "libs" "install" ]; meta = with stdenv.lib; { - homepage = "https://www.z88dk.org"; + homepage = "https://www.z88dk.org"; description = "z80 Development Kit"; - license = licenses.clArtistic; - maintainers = [ ]; - platforms = platforms.linux; + license = licenses.clArtistic; + maintainers = [ maintainers.siraben ]; + platforms = platforms.unix; }; } From 6681661989ccfb5fc5fd01ae8e53b2e12a6a0309 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sun, 3 Jan 2021 18:49:24 +0100 Subject: [PATCH 31/33] libmd: 1.0.1 -> 1.0.3 --- pkgs/development/libraries/libmd/default.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/libmd/default.nix b/pkgs/development/libraries/libmd/default.nix index a38e71bb540e..e3dd0b206f10 100644 --- a/pkgs/development/libraries/libmd/default.nix +++ b/pkgs/development/libraries/libmd/default.nix @@ -2,23 +2,19 @@ stdenv.mkDerivation rec { pname = "libmd"; - version = "1.0.1"; + version = "1.0.3"; src = fetchurl { url = "https://archive.hadrons.org/software/${pname}/${pname}-${version}.tar.xz"; - sha256 = "0waclg2d5qin3r26gy5jvy4584ik60njc8pqbzwk0lzq3j9ynkp1"; + sha256 = "0jmga8y94h857ilra3qjaiax3wd5pd6mx1h120zhl9fcjmzhj0js"; }; nativeBuildInputs = [ autoreconfHook ]; - # Writing the version to a .dist-version file is required for the get-version - # shell script because fetchgit removes the .git directory. - prePatch = '' - echo '${version}' > .dist-version; - ''; - meta = with stdenv.lib; { homepage = "https://www.hadrons.org/software/${pname}/"; + changelog = "https://archive.hadrons.org/software/libmd/libmd-${version}.announce"; + # Git: https://git.hadrons.org/cgit/libmd.git description = "Message Digest functions from BSD systems"; license = with licenses; [ bsd3 bsd2 isc beerware publicDomain ]; maintainers = with maintainers; [ primeos ]; From 16b53ed1e203864a90103840ea1f7b041d33ece3 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sun, 3 Jan 2021 19:02:13 +0100 Subject: [PATCH 32/33] html-proofer: 3.18.3 -> 3.18.5 --- pkgs/tools/misc/html-proofer/Gemfile.lock | 2 +- pkgs/tools/misc/html-proofer/gemset.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/misc/html-proofer/Gemfile.lock b/pkgs/tools/misc/html-proofer/Gemfile.lock index ce75c4e7fd89..3bd45730313a 100644 --- a/pkgs/tools/misc/html-proofer/Gemfile.lock +++ b/pkgs/tools/misc/html-proofer/Gemfile.lock @@ -6,7 +6,7 @@ GEM ethon (0.12.0) ffi (>= 1.3.0) ffi (1.14.2) - html-proofer (3.18.3) + html-proofer (3.18.5) addressable (~> 2.3) mercenary (~> 0.3) nokogumbo (~> 2.0) diff --git a/pkgs/tools/misc/html-proofer/gemset.nix b/pkgs/tools/misc/html-proofer/gemset.nix index da26cc347fe1..d6801512ca48 100644 --- a/pkgs/tools/misc/html-proofer/gemset.nix +++ b/pkgs/tools/misc/html-proofer/gemset.nix @@ -37,10 +37,10 @@ platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "0l0nkk0px6bc4g3xwc1c5fyi0c3n8sgl1zy94vqdzllfmkjvfggc"; + sha256 = "0bz0041fizdmggc5k9an4s3qk6diyybn2agcia2wr96vymfb2qjh"; type = "gem"; }; - version = "3.18.3"; + version = "3.18.5"; }; mercenary = { groups = ["default"]; From 6e43cc7fb0f22a88a989583ccf50e56f7f72ad6a Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 3 Jan 2021 19:04:33 +0100 Subject: [PATCH 33/33] nixos/prometheus-exporters: minor doc improvements * Content of `programlisting` shouldn't be indented, otherwise it's weirdly indented in the output. * Use `` in the release notes: then users can directly go to the option documentation when reading release notes. * Don't use docbook tags in `mkRemovedOptionModule`: it's only used during evaluation where docbook isn't rendered. --- nixos/doc/manual/release-notes/rl-2103.xml | 4 ++-- .../monitoring/prometheus/exporters/json.nix | 12 +++++------- .../monitoring/prometheus/exporters/rspamd.nix | 11 +++++------ 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2103.xml b/nixos/doc/manual/release-notes/rl-2103.xml index 0475c365504e..76aa3d839bfb 100644 --- a/nixos/doc/manual/release-notes/rl-2103.xml +++ b/nixos/doc/manual/release-notes/rl-2103.xml @@ -304,7 +304,7 @@ /probe endpoint. In the prometheus scrape configuration the scrape target might look like this: - http://some.json-exporter.host:7979/probe?target=https://example.com/some/json/endpoint +http://some.json-exporter.host:7979/probe?target=https://example.com/some/json/endpoint @@ -313,7 +313,7 @@ in the corresponding NixOS test. - These changes also affect services.prometheus.exporters.rspamd, which is + These changes also affect , which is just a preconfigured instance of the json exporter. diff --git a/nixos/modules/services/monitoring/prometheus/exporters/json.nix b/nixos/modules/services/monitoring/prometheus/exporters/json.nix index 24364aababd1..1800da69a255 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters/json.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters/json.nix @@ -4,7 +4,6 @@ with lib; let cfg = config.services.prometheus.exporters.json; - in { port = 7979; @@ -30,15 +29,14 @@ in (mkRemovedOptionModule [ "url" ] '' This option was removed. The URL of the endpoint serving JSON must now be provided to the exporter by prometheus via the url - parameter target. + parameter `target'. In prometheus a scrape URL would look like this: - - http://some.json-exporter.host:7979/probe?target=https://example.com/some/json/endpoint - - For more information, take a look at the - official documentation of the json_exporter. + http://some.json-exporter.host:7979/probe?target=https://example.com/some/json/endpoint + + For more information, take a look at the official documentation + (https://github.com/prometheus-community/json_exporter) of the json_exporter. '') ({ options.warnings = options.warnings; options.assertions = options.assertions; }) ]; diff --git a/nixos/modules/services/monitoring/prometheus/exporters/rspamd.nix b/nixos/modules/services/monitoring/prometheus/exporters/rspamd.nix index 84e7ba3554b7..78fe120e4d93 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters/rspamd.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters/rspamd.nix @@ -85,15 +85,14 @@ in (mkRemovedOptionModule [ "url" ] '' This option was removed. The URL of the rspamd metrics endpoint must now be provided to the exporter by prometheus via the url - parameter target. + parameter `target'. In prometheus a scrape URL would look like this: - - http://some.rspamd-exporter.host:7980/probe?target=http://some.rspamd.host:11334/stat - - For more information, take a look at the - official documentation of the json_exporter. + http://some.rspamd-exporter.host:7980/probe?target=http://some.rspamd.host:11334/stat + + For more information, take a look at the official documentation + (https://github.com/prometheus-community/json_exporter) of the json_exporter. '') ({ options.warnings = options.warnings; options.assertions = options.assertions; }) ];