Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 93bf798c31e4
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0ec29efbb76d
Choose a head ref
Loading
Showing with 336 additions and 297 deletions.
  1. +26 −0 nixos/doc/manual/release-notes/rl-2103.xml
  2. +1 −1 nixos/modules/security/pam.nix
  3. +2 −2 nixos/modules/services/monitoring/prometheus/default.nix
  4. +0 −2 nixos/modules/services/monitoring/prometheus/exporters.nix
  5. +18 −10 nixos/modules/services/monitoring/prometheus/exporters/json.nix
  6. +64 −57 nixos/modules/services/monitoring/prometheus/exporters/rspamd.nix
  7. +9 −6 nixos/tests/prometheus-exporters.nix
  8. +14 −0 nixos/tests/shadow.nix
  9. +3 −5 pkgs/applications/audio/vcv-rack/default.nix
  10. +3 −3 pkgs/applications/misc/dasel/default.nix
  11. +2 −2 pkgs/applications/misc/gramps/default.nix
  12. +6 −6 pkgs/applications/science/biology/bowtie2/default.nix
  13. +12 −14 pkgs/build-support/nix-gitignore/default.nix
  14. +9 −9 pkgs/development/compilers/z88dk/default.nix
  15. +3 −3 pkgs/development/interpreters/luajit/2.0.nix
  16. +3 −3 pkgs/development/interpreters/luajit/2.1.nix
  17. +4 −8 pkgs/development/libraries/libmd/default.nix
  18. +7 −4 pkgs/development/lua-modules/generic/default.nix
  19. +36 −0 pkgs/development/python-modules/aiomultiprocess/default.nix
  20. +2 −2 pkgs/development/python-modules/denonavr/default.nix
  21. +5 −2 pkgs/development/python-modules/py-air-control-exporter/default.nix
  22. +4 −2 pkgs/development/python-modules/sqlmap/default.nix
  23. +2 −2 pkgs/development/python-modules/xmodem/default.nix
  24. +10 −6 pkgs/development/tools/cargo-flamegraph/default.nix
  25. +3 −3 pkgs/development/tools/misc/tokei/default.nix
  26. +32 −0 pkgs/development/tools/rust/cargo-wipe/default.nix
  27. +12 −0 pkgs/misc/vim-plugins/generated.nix
  28. +1 −0 pkgs/misc/vim-plugins/vim-plugin-names
  29. +7 −1 pkgs/os-specific/linux/pam/default.nix
  30. +2 −2 pkgs/servers/dns/pdns-recursor/default.nix
  31. +9 −17 pkgs/servers/monitoring/prometheus/json-exporter.nix
  32. +0 −111 pkgs/servers/monitoring/prometheus/json-exporter_deps.nix
  33. +10 −2 pkgs/servers/pinnwand/default.nix
  34. +2 −2 pkgs/tools/misc/bdf2psf/default.nix
  35. +1 −1 pkgs/tools/misc/html-proofer/Gemfile.lock
  36. +2 −2 pkgs/tools/misc/html-proofer/gemset.nix
  37. +2 −2 pkgs/tools/misc/youtube-dl/default.nix
  38. +3 −3 pkgs/tools/networking/corerad/default.nix
  39. +2 −2 pkgs/tools/networking/megatools/default.nix
  40. +1 −0 pkgs/top-level/all-packages.nix
  41. +2 −0 pkgs/top-level/python-packages.nix
26 changes: 26 additions & 0 deletions nixos/doc/manual/release-notes/rl-2103.xml
Original file line number Diff line number Diff line change
@@ -309,6 +309,32 @@
Based on <xref linkend="opt-system.stateVersion" />, existing installations will continue to work.
</para>
</listitem>
<listitem>
<para>
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
<literal>/probe</literal> endpoint.
In the prometheus scrape configuration the scrape target might look like this:
<programlisting>
http://some.json-exporter.host:7979/probe?target=https://example.com/some/json/endpoint
</programlisting>
</para>
<para>
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.
</para>
<para>
These changes also affect <xref linkend="opt-services.prometheus.exporters.rspamd.enable" />, which is
just a preconfigured instance of the json exporter.
</para>
<para>
For more information, take a look at the <link xlink:href="https://github.com/prometheus-community/json_exporter">
official documentation</link> of the json_exporter.
</para>
</listitem>
</itemizedlist>
</section>

2 changes: 1 addition & 1 deletion nixos/modules/security/pam.nix
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions nixos/modules/services/monitoring/prometheus/default.nix
Original file line number Diff line number Diff line change
@@ -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.
'';

};
};

2 changes: 0 additions & 2 deletions nixos/modules/services/monitoring/prometheus/exporters.nix
Original file line number Diff line number Diff line change
@@ -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 {
28 changes: 18 additions & 10 deletions nixos/modules/services/monitoring/prometheus/exporters/json.nix
Original file line number Diff line number Diff line change
@@ -8,28 +8,36 @@ 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
(https://github.com/prometheus-community/json_exporter) of the json_exporter.
'')
({ options.warnings = options.warnings; options.assertions = options.assertions; })
];
}
121 changes: 64 additions & 57 deletions nixos/modules/services/monitoring/prometheus/exporters/rspamd.nix
Original file line number Diff line number Diff line change
@@ -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
<option>services.rspamd.enable</option> is true.
'';
};

extraLabels = mkOption {
type = types.attrsOf types.str;
default = {
@@ -84,9 +75,25 @@ 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
(https://github.com/prometheus-community/json_exporter) of the json_exporter.
'')
({ options.warnings = options.warnings; options.assertions = options.assertions; })
];
}
15 changes: 9 additions & 6 deletions nixos/tests/prometheus-exporters.nix
Original file line number Diff line number Diff line change
@@ -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'"
)
'';
};
14 changes: 14 additions & 0 deletions nixos/tests/shadow.nix
Original file line number Diff line number Diff line change
@@ -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 ]")
8 changes: 3 additions & 5 deletions pkgs/applications/audio/vcv-rack/default.nix
Original file line number Diff line number Diff line change
@@ -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 {
6 changes: 3 additions & 3 deletions pkgs/applications/misc/dasel/default.nix
Original file line number Diff line number Diff line change
@@ -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}
4 changes: 2 additions & 2 deletions pkgs/applications/misc/gramps/default.nix
Original file line number Diff line number Diff line change
@@ -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
Loading