From 6626bc544d2d66d0c348de98ce9649e750b6477e Mon Sep 17 00:00:00 2001 From: Zane van Iperen Date: Mon, 6 Dec 2021 13:36:56 +1000 Subject: [PATCH 01/26] openrussian-cli: force lua 5.3 And some cleanups. (cherry picked from commit 57e7a01eb362489d764af75806b469d69614b11b) --- pkgs/misc/openrussian-cli/default.nix | 6 ------ pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/pkgs/misc/openrussian-cli/default.nix b/pkgs/misc/openrussian-cli/default.nix index ce9a9e49c4ca..24c0b6bece78 100644 --- a/pkgs/misc/openrussian-cli/default.nix +++ b/pkgs/misc/openrussian-cli/default.nix @@ -25,12 +25,6 @@ stdenv.mkDerivation rec { dontConfigure = true; - # Disable check as it's too slow. - # doCheck = true; - - #This is needed even though it's the default for some reason. - checkTarget = "check"; - # Can't use "make install" here installPhase = '' runHook preInstall diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 13de9124e882..edc5491fecca 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8227,7 +8227,9 @@ with pkgs; openrgb = libsForQt5.callPackage ../applications/misc/openrgb { }; - openrussian-cli = callPackage ../misc/openrussian-cli { }; + openrussian-cli = callPackage ../misc/openrussian-cli { + luaPackages = lua53Packages; + }; opensc = callPackage ../tools/security/opensc { inherit (darwin.apple_sdk.frameworks) Carbon PCSC; From 982cd1e8886fdbf713927261df076ed6f2943fec Mon Sep 17 00:00:00 2001 From: Phillip Seeber Date: Mon, 22 Nov 2021 14:22:12 +0100 Subject: [PATCH 02/26] python3.pkgs.qcelemental: 0.23.0 -> 0.24.0 python3.pkgs.qcelemental: whitespace whitespace whitespace qcelemental: checkPhase (cherry picked from commit 51f4d2d2cd98f940f0baac3fb4f600036cf56ea8) --- .../python-modules/qcelemental/default.nix | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/qcelemental/default.nix b/pkgs/development/python-modules/qcelemental/default.nix index c0992e982510..0f1aa5cee7a2 100644 --- a/pkgs/development/python-modules/qcelemental/default.nix +++ b/pkgs/development/python-modules/qcelemental/default.nix @@ -1,26 +1,35 @@ -{ buildPythonPackage, lib, fetchPypi, numpy -, pydantic, pint, networkx, pytest-runner, pytest-cov, pytest +{ buildPythonPackage, lib, fetchPypi +, networkx +, numpy +, pint +, pydantic +, pytestCheckHook } : buildPythonPackage rec { pname = "qcelemental"; - version = "0.23.0"; - - checkInputs = [ pytest-runner pytest-cov pytest ]; - propagatedBuildInputs = [ numpy pydantic pint networkx ]; + version = "0.24.0"; src = fetchPypi { inherit pname version; - sha256 = "642bc86ce937621ddfb1291cbff0851be16b26feb5eec562296999e36181cee3"; + sha256 = "sha256-XcsR89tu26EG5AcXqmndkESLGWZ8eKmTkjaLziosawE="; }; + propagatedBuildInputs = [ + numpy + pydantic + pint + networkx + ]; + + checkInputs = [ pytestCheckHook ]; + doCheck = true; meta = with lib; { description = "Periodic table, physical constants, and molecule parsing for quantum chemistry"; homepage = "http://docs.qcarchive.molssi.org/projects/qcelemental/en/latest/"; license = licenses.bsd3; - platforms = platforms.linux; maintainers = [ maintainers.sheepforce ]; }; } From 2dfa2d76eb41d5195f31fa13208fcc451ffafdd6 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Wed, 8 Dec 2021 11:45:27 +0100 Subject: [PATCH 03/26] ocamlPackages.faillib: remove at 111.17.00 This is a legacy library for OCaml < 4.06 (cherry picked from commit 7aa74d9a137eb7afc281734382c5bade645e08f4) --- .../ocaml-modules/faillib/default.nix | 28 ------------------- pkgs/top-level/ocaml-packages.nix | 2 -- 2 files changed, 30 deletions(-) delete mode 100644 pkgs/development/ocaml-modules/faillib/default.nix diff --git a/pkgs/development/ocaml-modules/faillib/default.nix b/pkgs/development/ocaml-modules/faillib/default.nix deleted file mode 100644 index e2d90e06bdb5..000000000000 --- a/pkgs/development/ocaml-modules/faillib/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ lib, buildOcaml, fetchurl, ocaml, herelib, camlp4 }: - -if lib.versionAtLeast ocaml.version "4.06" -then throw "faillib-111.17.00 is not available for OCaml ${ocaml.version}" -else - -buildOcaml rec { - minimumSupportedOcamlVersion = "4.00"; - pname = "faillib"; - version = "111.17.00"; - - src = fetchurl { - url = "https://github.com/janestreet/faillib/archive/${version}.tar.gz"; - sha256 = "12dvaxkmgf7yzzvbadcyk1n17llgh6p8qr33867d21npaljy7l9v"; - }; - - propagatedBuildInputs = [ camlp4 herelib ]; - - doCheck = true; - checkPhase = "make test"; - - meta = with lib; { - homepage = "https://ocaml.janestreet.com/"; - description = "Library for dealing with failure in OCaml"; - license = licenses.asl20; - maintainers = [ maintainers.maurer ]; - }; -} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 6f44922032b0..b415d511407a 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -369,8 +369,6 @@ let facile = callPackage ../development/ocaml-modules/facile { }; - faillib = callPackage ../development/ocaml-modules/faillib { }; - faraday = callPackage ../development/ocaml-modules/faraday { }; faraday-async = callPackage ../development/ocaml-modules/faraday/async.nix { }; From 92c00af3da28838a3b7634ef49ca02f3f33611b2 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Wed, 8 Dec 2021 11:45:36 +0100 Subject: [PATCH 04/26] ocamlPackages.estring: remove broken (cherry picked from commit ea2f45793d53cb5703bb94c52818203c1900ebfb) --- .../ocaml-modules/estring/default.nix | 21 ------------------- pkgs/top-level/ocaml-packages.nix | 2 -- 2 files changed, 23 deletions(-) delete mode 100644 pkgs/development/ocaml-modules/estring/default.nix diff --git a/pkgs/development/ocaml-modules/estring/default.nix b/pkgs/development/ocaml-modules/estring/default.nix deleted file mode 100644 index c0cc3398763c..000000000000 --- a/pkgs/development/ocaml-modules/estring/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ lib, buildOcaml, ocaml, fetchurl }: - -if lib.versionAtLeast ocaml.version "4.06" -then throw "estring is not available for OCaml ${ocaml.version}" -else - -buildOcaml rec { - pname = "estring"; - version = "1.3"; - - src = fetchurl { - url = "https://forge.ocamlcore.org/frs/download.php/1012/estring-${version}.tar.gz"; - sha256 = "0b6znz5igm8pp28w4b7sgy82rpd9m5aw6ss933rfbw1mrh05gvcg"; - }; - - meta = with lib; { - homepage = "http://estring.forge.ocamlcore.org/"; - description = "Extension for string literals"; - license = licenses.bsd3; - }; -} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index b415d511407a..b80eb3f0e559 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -359,8 +359,6 @@ let erm_xmpp = callPackage ../development/ocaml-modules/erm_xmpp { }; - estring = callPackage ../development/ocaml-modules/estring { }; - ethernet = callPackage ../development/ocaml-modules/ethernet { }; ezjsonm = callPackage ../development/ocaml-modules/ezjsonm { }; From 15e9593766c7e9662b95f24f308134dbea859185 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 16 Dec 2021 11:55:38 +0100 Subject: [PATCH 05/26] mediawiki: 1.36.2 -> 1.36.3 --- pkgs/servers/web-apps/mediawiki/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/web-apps/mediawiki/default.nix b/pkgs/servers/web-apps/mediawiki/default.nix index 6d49632a8328..5cb0130cbeda 100644 --- a/pkgs/servers/web-apps/mediawiki/default.nix +++ b/pkgs/servers/web-apps/mediawiki/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "mediawiki"; - version = "1.36.2"; + version = "1.36.3"; src = with lib; fetchurl { url = "https://releases.wikimedia.org/mediawiki/${versions.majorMinor version}/${pname}-${version}.tar.gz"; - sha256 = "sha256-xzV93phEnIY1E029gnkGYNcyWSywLL/zV0Nh3zn+4tQ="; + sha256 = "sha256-Rjfyh9V+Ryqpg5P++Kxy+hV0xgaZYbtQtYc1Tsmwiyg="; }; prePatch = '' From e0c586a033d1897cdcf4a35692899def4ce3a8aa Mon Sep 17 00:00:00 2001 From: Phillip Seeber Date: Thu, 16 Dec 2021 14:03:11 +0100 Subject: [PATCH 06/26] qcelemental: disabled pubchem tests (trying network on darwin) --- pkgs/development/python-modules/qcelemental/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/qcelemental/default.nix b/pkgs/development/python-modules/qcelemental/default.nix index 0f1aa5cee7a2..1808cba6a99b 100644 --- a/pkgs/development/python-modules/qcelemental/default.nix +++ b/pkgs/development/python-modules/qcelemental/default.nix @@ -26,6 +26,8 @@ buildPythonPackage rec { doCheck = true; + disabledTestPaths = [ "qcelemental/tests/test_molparse_pubchem.py" ]; + meta = with lib; { description = "Periodic table, physical constants, and molecule parsing for quantum chemistry"; homepage = "http://docs.qcarchive.molssi.org/projects/qcelemental/en/latest/"; From d7f3bad8900f6d415a279fd4ac55b8415b666cec Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Thu, 9 Dec 2021 10:22:30 +0100 Subject: [PATCH 07/26] gnonograms: 1.4.5 -> 2.0.0 (cherry picked from commit 2c2e6383a885a4b76f492a83882114e85499c9d8) --- pkgs/games/gnonograms/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/games/gnonograms/default.nix b/pkgs/games/gnonograms/default.nix index 7a696001a15f..cfe1085ca27b 100644 --- a/pkgs/games/gnonograms/default.nix +++ b/pkgs/games/gnonograms/default.nix @@ -13,17 +13,18 @@ , gtk3 , pantheon , libgee +, libhandy }: stdenv.mkDerivation rec { pname = "gnonograms"; - version = "1.4.5"; + version = "2.0.0"; src = fetchFromGitHub { owner = "jeremypw"; repo = "gnonograms"; rev = "v${version}"; - sha256 = "1ly3inp6dvjrixdysz5hdfwlhbs49ks0lf8062z2iq6gaf8ivkb2"; + sha256 = "sha256-2uXaybpCAm9cr0o7bqfhgD7mMNPwtv1X/PgnFnSDOl0="; }; postPatch = '' @@ -46,6 +47,7 @@ stdenv.mkDerivation rec { gtk3 pantheon.granite libgee + libhandy ]; meta = with lib; { From 59090dd834006a8945d5b21fa1d435c63ba2e93d Mon Sep 17 00:00:00 2001 From: Robin Townsend Date: Tue, 30 Nov 2021 16:02:00 -0500 Subject: [PATCH 08/26] minecraft-server: 1.17.1 -> 1.18 (cherry picked from commit 43ec279d771da1ba85be75159de93f0f0d13d2bd) --- pkgs/games/minecraft-server/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/games/minecraft-server/default.nix b/pkgs/games/minecraft-server/default.nix index 2304acf446df..5d7506ba160b 100644 --- a/pkgs/games/minecraft-server/default.nix +++ b/pkgs/games/minecraft-server/default.nix @@ -1,12 +1,12 @@ { lib, stdenv, fetchurl, nixosTests, jre_headless }: stdenv.mkDerivation { pname = "minecraft-server"; - version = "1.17.1"; + version = "1.18"; src = fetchurl { - url = "https://launcher.mojang.com/v1/objects/a16d67e5807f57fc4e550299cf20226194497dc2/server.jar"; + url = "https://launcher.mojang.com/v1/objects/3cf24a8694aca6267883b17d934efacc5e44440d/server.jar"; # sha1 because that comes from mojang via api - sha1 = "a16d67e5807f57fc4e550299cf20226194497dc2"; + sha1 = "3cf24a8694aca6267883b17d934efacc5e44440d"; }; preferLocalBuild = true; From 6cc6270a4f708c6252301ffadb931e298c9c2ede Mon Sep 17 00:00:00 2001 From: Joel Date: Sat, 11 Dec 2021 18:51:43 +1000 Subject: [PATCH 09/26] minecraft-server: 1.18 -> 1.18.1 (#149982) (cherry picked from commit b835bec4d74f47d802031cb129cd0abe6c5f95cc) --- pkgs/games/minecraft-server/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/games/minecraft-server/default.nix b/pkgs/games/minecraft-server/default.nix index 5d7506ba160b..02054f1ad8b5 100644 --- a/pkgs/games/minecraft-server/default.nix +++ b/pkgs/games/minecraft-server/default.nix @@ -1,12 +1,12 @@ { lib, stdenv, fetchurl, nixosTests, jre_headless }: stdenv.mkDerivation { pname = "minecraft-server"; - version = "1.18"; + version = "1.18.1"; src = fetchurl { - url = "https://launcher.mojang.com/v1/objects/3cf24a8694aca6267883b17d934efacc5e44440d/server.jar"; + url = "https://launcher.mojang.com/v1/objects/125e5adf40c659fd3bce3e66e67a16bb49ecc1b9/server.jar"; # sha1 because that comes from mojang via api - sha1 = "3cf24a8694aca6267883b17d934efacc5e44440d"; + sha1 = "125e5adf40c659fd3bce3e66e67a16bb49ecc1b9"; }; preferLocalBuild = true; From f4f67d4efaafb1564bff42682964d7dfd016dcfd Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 7 Dec 2021 14:37:34 +0000 Subject: [PATCH 10/26] mednaffe: 0.9.1 -> 0.9.2 (cherry picked from commit fd354779e3e7fe9a876df48a9ac065f53a4de9cc) --- pkgs/misc/emulators/mednaffe/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/misc/emulators/mednaffe/default.nix b/pkgs/misc/emulators/mednaffe/default.nix index 8a11b633d28e..e92836ae34d5 100644 --- a/pkgs/misc/emulators/mednaffe/default.nix +++ b/pkgs/misc/emulators/mednaffe/default.nix @@ -11,13 +11,13 @@ stdenv.mkDerivation rec { pname = "mednaffe"; - version = "0.9.1"; + version = "0.9.2"; src = fetchFromGitHub { owner = "AmatCoder"; repo = "mednaffe"; rev = version; - sha256 = "sha256-YU8PHnQHAsY90LN/WDugi4WhsuZGBj/z3BS4o69qMS4="; + sha256 = "sha256-zvSAt6CMcgdoPpTTA5sPlQaWUw9LUMsR2Xg9jM2UaWY="; }; nativeBuildInputs = [ autoreconfHook pkg-config wrapGAppsHook ]; From 386506c2682ebe8808bb963b9671b0c35e876f9a Mon Sep 17 00:00:00 2001 From: talyz Date: Wed, 15 Dec 2021 19:14:12 +0100 Subject: [PATCH 11/26] elk7: 7.11.1 -> 7.16.1 (cherry picked from commit 6c5a5337970dc8aa9dd96c1b2b13cdc0250a66b4) --- .../modules/services/logging/journalbeat.nix | 1 - nixos/tests/elk.nix | 12 ++++------ pkgs/development/tools/misc/kibana/7.x.nix | 10 ++++---- pkgs/misc/logging/beats/7.x.nix | 24 ++++++++----------- pkgs/servers/search/elasticsearch/7.x.nix | 6 ++--- pkgs/servers/search/elasticsearch/plugins.nix | 20 ++++++++-------- pkgs/tools/misc/logstash/7.x.nix | 12 +++++----- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 5 ++-- 9 files changed, 41 insertions(+), 50 deletions(-) diff --git a/nixos/modules/services/logging/journalbeat.nix b/nixos/modules/services/logging/journalbeat.nix index 2d98598c1bee..b34fb308f586 100644 --- a/nixos/modules/services/logging/journalbeat.nix +++ b/nixos/modules/services/logging/journalbeat.nix @@ -28,7 +28,6 @@ in type = types.package; default = pkgs.journalbeat; defaultText = literalExpression "pkgs.journalbeat"; - example = literalExpression "pkgs.journalbeat7"; description = '' The journalbeat package to use ''; diff --git a/nixos/tests/elk.nix b/nixos/tests/elk.nix index ae746d7e1f03..1dae625987f5 100644 --- a/nixos/tests/elk.nix +++ b/nixos/tests/elk.nix @@ -40,9 +40,8 @@ let services = { - journalbeat = let lt6 = builtins.compareVersions - elk.journalbeat.version "6" < 0; in { - enable = true; + journalbeat = { + enable = elk ? journalbeat; package = elk.journalbeat; extraConfig = pkgs.lib.mkOptionDefault ('' logging: @@ -51,8 +50,6 @@ let metrics.enabled: false output.elasticsearch: hosts: [ "127.0.0.1:9200" ] - ${pkgs.lib.optionalString lt6 "template.enabled: false"} - '' + pkgs.lib.optionalString (!lt6) '' journalbeat.inputs: - paths: [] seek: cursor @@ -202,6 +199,7 @@ let one.wait_until_succeeds(total_hits("flowers") + " | grep -v 0") one.wait_until_succeeds(total_hits("dragons") + " | grep 0") + '' + lib.optionalString (elk ? journalbeat) '' with subtest( "A message logged to the journal is ingested by elasticsearch via journalbeat" ): @@ -210,7 +208,7 @@ let one.wait_until_succeeds( total_hits("Supercalifragilisticexpialidocious") + " | grep -v 0" ) - + '' + '' with subtest("Elasticsearch-curator works"): one.systemctl("stop logstash") one.systemctl("start elasticsearch-curator") @@ -235,7 +233,6 @@ in { # elasticsearch = pkgs.elasticsearch7-oss; # logstash = pkgs.logstash7-oss; # kibana = pkgs.kibana7-oss; - # journalbeat = pkgs.journalbeat7; # metricbeat = pkgs.metricbeat7; # }; unfree = lib.dontRecurseIntoAttrs { @@ -250,7 +247,6 @@ in { elasticsearch = pkgs.elasticsearch7; logstash = pkgs.logstash7; kibana = pkgs.kibana7; - journalbeat = pkgs.journalbeat7; metricbeat = pkgs.metricbeat7; }; }; diff --git a/pkgs/development/tools/misc/kibana/7.x.nix b/pkgs/development/tools/misc/kibana/7.x.nix index 7a2e0d1d3647..455f95a69eb0 100644 --- a/pkgs/development/tools/misc/kibana/7.x.nix +++ b/pkgs/development/tools/misc/kibana/7.x.nix @@ -4,23 +4,23 @@ , stdenv , makeWrapper , fetchurl -, nodejs-14_x +, nodejs-16_x , coreutils , which }: with lib; let - nodejs = nodejs-14_x; + nodejs = nodejs-16_x; inherit (builtins) elemAt; info = splitString "-" stdenv.hostPlatform.system; arch = elemAt info 0; plat = elemAt info 1; shas = { - x86_64-linux = "19p9s4sir982bb1zcldrbphhwfs9i11p0q28vgc421iqg10kjlf1"; - x86_64-darwin = "0qq557ngwwakifidyrccga4cadj9k9pzhjwy4msmbcgf5pb86qyc"; - aarch64-linux = "183cp1h8d3n7xfcpcys4hf36palczxa409afyp62kzyzckngy0j8"; + x86_64-linux = "0jivwsrq31n0qfznrsjfsn65sg3wpbd990afn2wzjnj4drq7plz6"; + x86_64-darwin = "02483aqzrccq1x6rwznmcazijdd46yxj9vnbihnvp2xyp3w9as45"; + aarch64-linux = "0iw155gkkl1hshc80lfj95rssg039ig21wz1l3srmmf2x4f934s9"; }; in stdenv.mkDerivation rec { diff --git a/pkgs/misc/logging/beats/7.x.nix b/pkgs/misc/logging/beats/7.x.nix index b8b82ed4b308..9f5e550d9720 100644 --- a/pkgs/misc/logging/beats/7.x.nix +++ b/pkgs/misc/logging/beats/7.x.nix @@ -8,10 +8,10 @@ let beat = package: extraArgs: buildGoModule (rec { owner = "elastic"; repo = "beats"; rev = "v${version}"; - sha256 = "0gjyzprgj9nskvlkm2bf125b7qn3608llz4kh1fyzsvrw6zb7sm8"; + sha256 = "sha256-9Jl5Xo1iKdOY9ZE5JXKSL4ee+NdsN3KCY2dDYuxlzPI="; }; - vendorSha256 = "04cwf96fh60ld3ndjzzssgirc9ssb53yq71j6ksx36m3y1x7fq9c"; + vendorSha256 = "sha256-tyxyM7RsTHTVVxc9gagPsSvFRaWGTmobKzyv9RODXBk="; subPackages = [ package ]; @@ -24,7 +24,14 @@ let beat = package: extraArgs: buildGoModule (rec { } // extraArgs); in rec { - filebeat7 = beat "filebeat" { meta.description = "Lightweight shipper for logfiles"; }; + filebeat7 = beat "filebeat" { + meta.description = "Lightweight shipper for logfiles"; + buildInputs = [ systemd ]; + tags = [ "withjournald" ]; + postFixup = '' + patchelf --set-rpath ${lib.makeLibraryPath [ (lib.getLib systemd) ]} "$out/bin/filebeat" + ''; + }; heartbeat7 = beat "heartbeat" { meta.description = "Lightweight shipper for uptime monitoring"; }; metricbeat7 = beat "metricbeat" { meta.description = "Lightweight shipper for metrics"; @@ -47,15 +54,4 @@ rec { PostgreSQL, Redis or Thrift and correlate the messages into transactions. ''; }; - journalbeat7 = beat "journalbeat" { - meta.description = '' - Journalbeat is an open source data collector to read and forward - journal entries from Linuxes with systemd. - ''; - buildInputs = [ systemd.dev ]; - postFixup = let libPath = lib.makeLibraryPath [ (lib.getLib systemd) ]; in - '' - patchelf --set-rpath ${libPath} "$out/bin/journalbeat" - ''; - }; } diff --git a/pkgs/servers/search/elasticsearch/7.x.nix b/pkgs/servers/search/elasticsearch/7.x.nix index c254b733837b..592cc947a42e 100644 --- a/pkgs/servers/search/elasticsearch/7.x.nix +++ b/pkgs/servers/search/elasticsearch/7.x.nix @@ -18,9 +18,9 @@ let plat = elemAt info 1; shas = { - x86_64-linux = "1ld7656b37l67vi4pyv0il865b168niqnbd4hzbvdnwrm35prp10"; - x86_64-darwin = "11b180y11xw5q01l7aw6lyn15lp9ks8xmakjg1j7gp3z6c90hpn3"; - aarch64-linux = "0s4ph79x17f90jk31wjwk259dk9dmhnmnkxdcn77m191wvf6m3wy"; + x86_64-linux = "1s16l95wc589cr69pfbgmkn9rkvxn6sd6jlbiqpm6p6iyxiaxd6c"; + x86_64-darwin = "05h7pvq4pb816wgcymnfklp3w6sv54x6138v2infw5219dnk8pfs"; + aarch64-linux = "0q4xnjzhlx1b2lkikca88qh9glfxaifsm419k2bxxlrfrx31zlkq"; }; in stdenv.mkDerivation rec { diff --git a/pkgs/servers/search/elasticsearch/plugins.nix b/pkgs/servers/search/elasticsearch/plugins.nix index f71d7b9cc76c..baeeec5c67a7 100644 --- a/pkgs/servers/search/elasticsearch/plugins.nix +++ b/pkgs/servers/search/elasticsearch/plugins.nix @@ -38,7 +38,7 @@ in src = fetchurl { url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/${pluginName}/${pluginName}-${version}.zip"; sha256 = - if version == "7.11.1" then "0mi6fmnjbqypa4n1w34dvlmyq793pz4wf1r5srcs7i84kkiddysy" + if version == "7.16.1" then "1sz858m9963xqr5kzjlwnq7k0a146rn60v6xijyfbp8y3brg618p" else if version == "6.8.3" then "0vbaqyj0lfy3ijl1c9h92b0nh605h5mjs57bk2zhycdvbw5sx2lv" else throw "unsupported version ${version} for plugin ${pluginName}"; }; @@ -55,7 +55,7 @@ in src = fetchurl { url = "https://github.com/vhyza/elasticsearch-${pluginName}/releases/download/v${version}/elasticsearch-${pluginName}-${version}-plugin.zip"; sha256 = - if version == "7.11.1" then "0r2k2ndgqiqh27lch8dbay1m09f00h5kjcan87chcvyf623l40a3" + if version == "7.16.1" then "0yjy9yhw77lmalivxnmv2rq8fk93ddxszkk73lgmpffladx2ikir" else if version == "6.8.3" then "12bshvp01pp2lgwd0cn9l58axg8gdimsh4g9wfllxi1bdpv4cy53" else throw "unsupported version ${version} for plugin ${pluginName}"; }; @@ -72,7 +72,7 @@ in src = fetchurl { url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/${pluginName}/${pluginName}-${version}.zip"; sha256 = - if version == "7.11.1" then "10ln81zyf04qi9wv10mck8iz0xwfvwp4ni0hl1gkgvh44lf1n855" + if version == "7.16.1" then "1w5ndgffqzj5ijglmykifrk1jsgh7qwn8m7sbpiv0r7n3aayhz1x" else if version == "6.8.3" then "0ggdhf7w50bxsffmcznrjy14b578fps0f8arg3v54qvj94v9jc37" else throw "unsupported version ${version} for plugin ${pluginName}"; }; @@ -89,7 +89,7 @@ in src = fetchurl { url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/${pluginName}/${pluginName}-${version}.zip"; sha256 = - if version == "7.11.1" then "09grfvqjmm2rznc48z84awh54afh81qa16amfqw3amsb8dr6czm6" + if version == "7.16.1" then "16mv7b9nl96bcygabvjqidxp2sjk340va19mrmliblpq3mxa2sii" else if version == "6.8.3" then "0pmffz761dqjpvmkl7i7xsyw1iyyspqpddxp89rjsznfc9pak5im" else throw "unsupported version ${version} for plugin ${pluginName}"; }; @@ -106,7 +106,7 @@ in src = fetchurl { url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/${pluginName}/${pluginName}-${version}.zip"; sha256 = - if version == "7.11.1" then "0imkf3w2fmspb78vkf9k6kqx1crm4f82qgnbk1qa7gbsa2j47hbs" + if version == "7.16.1" then "0bf8f8cybsp6s2ai3j04yay9kbhsafpgxivxjvzn2iy9qgc84ls4" else if version == "6.8.3" then "0kfr4i2rcwinjn31xrc2piicasjanaqcgnbif9xc7lnak2nnzmll" else throw "unsupported version ${version} for plugin ${pluginName}"; }; @@ -123,7 +123,7 @@ in src = fetchurl { url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/${pluginName}/${pluginName}-${esVersion}.zip"; sha256 = - if version == "7.11.1" then "0ahyb1plgwvq22id2kcx9g076ybb3kvybwakgcvsdjjdyi4cwgjs" + if version == "7.16.1" then "0sfa0ql3hh8jmha230dyhr51bvsvwmazyycf36ngpmxsysm8ccml" else if version == "6.8.3" then "1mm6hj2m1db68n81rzsvlw6nisflr5ikzk5zv9nmk0z641n5vh1x" else throw "unsupported version ${version} for plugin ${pluginName}"; }; @@ -140,7 +140,7 @@ in src = fetchurl { url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/${pluginName}/${pluginName}-${esVersion}.zip"; sha256 = - if version == "7.11.1" then "0i98b905k1zwm3y9pfhr40v2fm5qdsp3icygibhxf7drffygk4l7" + if version == "7.16.1" then "1b95hjr4qhiavm7r7k19bwk5c64r00f1g5s0ydnb6gzym9hdb5s1" else if version == "6.8.3" then "1s2klpvnhpkrk53p64zbga3b66czi7h1a13f58kfn2cn0zfavnbk" else throw "unsupported version ${version} for plugin ${pluginName}"; }; @@ -157,14 +157,14 @@ in pluginName = "search-guard"; version = # https://docs.search-guard.com/latest/search-guard-versions - if esVersion == "7.11.1" then "${esVersion}-50.0.0" + if esVersion == "7.16.1" then "${esVersion}-52.5.0" else if esVersion == "6.8.3" then "${esVersion}-25.5" else throw "unsupported version ${esVersion} for plugin ${pluginName}"; src = - if esVersion == "7.11.1" then + if esVersion == "7.16.1" then fetchurl { url = "https://maven.search-guard.com/search-guard-suite-release/com/floragunn/search-guard-suite-plugin/${version}/search-guard-suite-plugin-${version}.zip"; - sha256 = "1lippygiy0xcxxlakylhvj3bj2i681k6jcfjsprkfk7hlaqsqxkm"; + sha256 = "1m3nj35qyrkkh3mhmn66nippavima8h8qpaxddalhjsvf70lhnjb"; } else if esVersion == "6.8.3" then fetchurl { diff --git a/pkgs/tools/misc/logstash/7.x.nix b/pkgs/tools/misc/logstash/7.x.nix index 1e69fbc976d9..636c380817ce 100644 --- a/pkgs/tools/misc/logstash/7.x.nix +++ b/pkgs/tools/misc/logstash/7.x.nix @@ -17,14 +17,14 @@ let shas = if enableUnfree then { - x86_64-linux = "0yjaki7gjffrz86hvqgn1gzhd9dc9llcj50g2x1sgpyn88zk0z0p"; - x86_64-darwin = "0dqm66c89w1nvmbwqzphlqmf7avrycgv1nwd5b0k1z168fj0c3zm"; - aarch64-linux = "11hjhyb48mjagmvqyxb780n57kr619h6p4adl2vs1zm97g9gslx8"; + x86_64-linux = "1vm53alq9q1qy2jcsjg9z339xrkac5r9qqpdafp53ny4zsv1n7vj"; + x86_64-darwin = "0hhjyl04h3gd66rdk22272rj419br4v2i59lyrmaj6hmnsqbv968"; + aarch64-linux = "0yjaki7gjffrz86hvqgn1gzhd9dc9llcj50g2x1sgpyn88zk0z0p"; } else { - x86_64-linux = "14b1649avjcalcsi0ffkgznq6d93qdk6m3j0i73mwfqka5d3dvy3"; - x86_64-darwin = "0ypgdfklr5rxvsnc3czh231pa1z2h70366j1c6q5g64b3xnxpphs"; - aarch64-linux = "01ainayr8fwwfix7dmxfhhmb23ji65dn4lbjwnj2w0pl0ym9h9w2"; + x86_64-linux = "1f3659vcgczm7v03q3fvsmp1ndp6wm3i7r2b2vbl4xq7hf9v7azk"; + x86_64-darwin = "10zw9qc0lc0x9in0nkxc1aiazhyd69l8sya2ni46ivyyjwf0sqsn"; + aarch64-linux = "1czhgmky2zf3mqykn5ww4257yfhd36mi4x6dq569ymly83pivf8v"; }; this = stdenv.mkDerivation rec { version = elk7Version; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 92029a498e18..cb43f4f6201c 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -380,6 +380,7 @@ mapAliases ({ jbuilder = dune_1; # added 2018-09-09 jikes = throw "jikes was deprecated on 2019-10-07: abandoned by upstream"; joseki = apache-jena-fuseki; # added 2016-02-28 + journalbeat7 = throw "journalbeat has been removed upstream. Use filebeat with the journald input instead."; jvmci8 = throw "graalvm8 and its tools were deprecated in favor of graalvm8-ce"; # added 2021-10-15 json_glib = json-glib; # added 2018-02-25 kafkacat = kcat; # added 2021-10-07 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index edc5491fecca..bdd2c24727c4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2109,8 +2109,7 @@ with pkgs; filebeat7 heartbeat7 metricbeat7 - packetbeat7 - journalbeat7; + packetbeat7; filebeat = filebeat6; heartbeat = heartbeat6; @@ -4920,7 +4919,7 @@ with pkgs; # The latest version used by elasticsearch, logstash, kibana and the the beats from elastic. # When updating make sure to update all plugins or they will break! elk6Version = "6.8.3"; - elk7Version = "7.11.1"; + elk7Version = "7.16.1"; elasticsearch6 = callPackage ../servers/search/elasticsearch/6.x.nix { util-linux = util-linuxMinimal; From bd8496ff4fecc2305d631912581f75f6417b43a2 Mon Sep 17 00:00:00 2001 From: talyz Date: Wed, 15 Dec 2021 19:22:48 +0100 Subject: [PATCH 12/26] nixosTests.elk: Improve reliability and compatibility with ELK 7.x - Use comparisons in jq instead of grepping - Match for `.hits.total.value` if version >= 7, otherwise it always passes - Make curl fail if requests fails (cherry picked from commit 9647a429eddd1fc70dd2b9a29c0b79233b3bf5aa) --- nixos/tests/elk.nix | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/nixos/tests/elk.nix b/nixos/tests/elk.nix index 1dae625987f5..8db49ecfb18a 100644 --- a/nixos/tests/elk.nix +++ b/nixos/tests/elk.nix @@ -139,27 +139,43 @@ let }; passthru.elkPackages = elk; - testScript = '' + testScript = + let + valueObject = lib.optionalString (lib.versionAtLeast elk.elasticsearch.version "7") ".value"; + in '' import json - def total_hits(message): + def expect_hits(message): dictionary = {"query": {"match": {"message": message}}} return ( - "curl --silent --show-error '${esUrl}/_search' " + "curl --silent --show-error --fail-with-body '${esUrl}/_search' " + "-H 'Content-Type: application/json' " + "-d '{}' ".format(json.dumps(dictionary)) - + "| jq .hits.total" + + " | tee /dev/console" + + " | jq -es 'if . == [] then null else .[] | .hits.total${valueObject} > 0 end'" + ) + + + def expect_no_hits(message): + dictionary = {"query": {"match": {"message": message}}} + return ( + "curl --silent --show-error --fail-with-body '${esUrl}/_search' " + + "-H 'Content-Type: application/json' " + + "-d '{}' ".format(json.dumps(dictionary)) + + " | tee /dev/console" + + " | jq -es 'if . == [] then null else .[] | .hits.total${valueObject} == 0 end'" ) def has_metricbeat(): dictionary = {"query": {"match": {"event.dataset": {"query": "system.cpu"}}}} return ( - "curl --silent --show-error '${esUrl}/_search' " + "curl --silent --show-error --fail-with-body '${esUrl}/_search' " + "-H 'Content-Type: application/json' " + "-d '{}' ".format(json.dumps(dictionary)) - + "| jq '.hits.total > 0'" + + " | tee /dev/console" + + " | jq -es 'if . == [] then null else .[] | .hits.total${valueObject} > 0 end'" ) @@ -175,7 +191,8 @@ let # TODO: extend this test with multiple elasticsearch nodes # and see if the status turns "green". one.wait_until_succeeds( - "curl --silent --show-error '${esUrl}/_cluster/health' | jq .status | grep -v red" + "curl --silent --show-error --fail-with-body '${esUrl}/_cluster/health'" + + " | jq -es 'if . == [] then null else .[] | .status != \"red\" end'" ) with subtest("Perform some simple logstash tests"): @@ -186,18 +203,19 @@ let with subtest("Kibana is healthy"): one.wait_for_unit("kibana.service") one.wait_until_succeeds( - "curl --silent --show-error 'http://localhost:5601/api/status' | jq .status.overall.state | grep green" + "curl --silent --show-error --fail-with-body 'http://localhost:5601/api/status'" + + " | jq -es 'if . == [] then null else .[] | .status.overall.state == \"green\" end'" ) with subtest("Metricbeat is running"): one.wait_for_unit("metricbeat.service") with subtest("Metricbeat metrics arrive in elasticsearch"): - one.wait_until_succeeds(has_metricbeat() + " | tee /dev/console | grep 'true'") + one.wait_until_succeeds(has_metricbeat()) with subtest("Logstash messages arive in elasticsearch"): - one.wait_until_succeeds(total_hits("flowers") + " | grep -v 0") - one.wait_until_succeeds(total_hits("dragons") + " | grep 0") + one.wait_until_succeeds(expect_hits("flowers")) + one.wait_until_succeeds(expect_no_hits("dragons")) '' + lib.optionalString (elk ? journalbeat) '' with subtest( @@ -206,7 +224,7 @@ let one.wait_for_unit("journalbeat.service") one.execute("echo 'Supercalifragilisticexpialidocious' | systemd-cat") one.wait_until_succeeds( - total_hits("Supercalifragilisticexpialidocious") + " | grep -v 0" + expect_hits("Supercalifragilisticexpialidocious") ) '' + '' with subtest("Elasticsearch-curator works"): From c10f38444656dcdc2a086141974e936e3977dcb1 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Fri, 10 Dec 2021 10:46:43 +0100 Subject: [PATCH 13/26] opensnitch: fix daemon cant find iptables in PATH (cherry picked from commit a05790a5bfb79e1284f00101d14f1c7da2c3a973) --- pkgs/tools/networking/opensnitch/daemon.nix | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pkgs/tools/networking/opensnitch/daemon.nix b/pkgs/tools/networking/opensnitch/daemon.nix index 31057a8f5271..b15670474ef3 100644 --- a/pkgs/tools/networking/opensnitch/daemon.nix +++ b/pkgs/tools/networking/opensnitch/daemon.nix @@ -7,6 +7,7 @@ , lib , coreutils , iptables +, makeWrapper }: buildGoModule rec { @@ -32,21 +33,25 @@ buildGoModule rec { modRoot = "daemon"; + vendorSha256 = "sha256-LMwQBFkHg1sWIUITLOX2FZi5QUfOivvrkcl9ELO3Trk="; + + nativeBuildInputs = [ pkg-config makeWrapper ]; + + buildInputs = [ libnetfilter_queue libnfnetlink ]; + postBuild = '' mv $GOPATH/bin/daemon $GOPATH/bin/opensnitchd mkdir -p $out/lib/systemd/system substitute opensnitchd.service $out/lib/systemd/system/opensnitchd.service \ - --replace "/usr/local/bin/opensnitchd" "$out/bin/opensnitchd" \ + --replace "/usr/local/bin/opensnitchd" "${out}/bin/opensnitchd" \ --replace "/etc/opensnitchd/rules" "/var/lib/opensnitch/rules" \ --replace "/bin/mkdir" "${coreutils}/bin/mkdir" - sed -i '/\[Service\]/a Environment=PATH=${iptables}/bin' $out/lib/systemd/system/opensnitchd.service ''; - vendorSha256 = "sha256-LMwQBFkHg1sWIUITLOX2FZi5QUfOivvrkcl9ELO3Trk="; - - nativeBuildInputs = [ pkg-config ]; - - buildInputs = [ libnetfilter_queue libnfnetlink ]; + postInstall = '' + wrapProgram $out/bin/opensnitchd \ + --prefix PATH : ${lib.makeBinPath [ iptables ]} + ''; meta = with lib; { description = "An application firewall"; From cbed61a3c2264420bc75291d389e735e998edc1e Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Fri, 10 Dec 2021 11:00:25 +0100 Subject: [PATCH 14/26] opensnitch: fix daemon cant find iptables in PATH (cherry picked from commit 4d6cb6b4c8ebc35d848fe0ef5cda1ce5fcd6e072) --- pkgs/tools/networking/opensnitch/daemon.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/networking/opensnitch/daemon.nix b/pkgs/tools/networking/opensnitch/daemon.nix index b15670474ef3..2ebf9425f0e5 100644 --- a/pkgs/tools/networking/opensnitch/daemon.nix +++ b/pkgs/tools/networking/opensnitch/daemon.nix @@ -43,7 +43,7 @@ buildGoModule rec { mv $GOPATH/bin/daemon $GOPATH/bin/opensnitchd mkdir -p $out/lib/systemd/system substitute opensnitchd.service $out/lib/systemd/system/opensnitchd.service \ - --replace "/usr/local/bin/opensnitchd" "${out}/bin/opensnitchd" \ + --replace "/usr/local/bin/opensnitchd" "$out/bin/opensnitchd" \ --replace "/etc/opensnitchd/rules" "/var/lib/opensnitch/rules" \ --replace "/bin/mkdir" "${coreutils}/bin/mkdir" ''; From 65cdf44b89ddbbb7e551b94fb0155d8331e43d52 Mon Sep 17 00:00:00 2001 From: talyz Date: Wed, 15 Dec 2021 19:38:35 +0100 Subject: [PATCH 15/26] nixos/filebeat: Add initial module and test Filebeat is an open source file harvester, mostly used to fetch logs files and feed them into logstash. This module can be used instead of journalbeat if used with `filebeat7` and configured with the `journald` input. (cherry picked from commit 6c9c2b47346c3584dce0607e8821b961666a5c85) --- nixos/modules/module-list.nix | 1 + nixos/modules/services/logging/filebeat.nix | 253 ++++++++++++++++++++ nixos/tests/elk.nix | 36 ++- 3 files changed, 289 insertions(+), 1 deletion(-) create mode 100644 nixos/modules/services/logging/filebeat.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 9eca0b8d65f2..c397271e2f3e 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -446,6 +446,7 @@ ./services/hardware/xow.nix ./services/logging/SystemdJournal2Gelf.nix ./services/logging/awstats.nix + ./services/logging/filebeat.nix ./services/logging/fluentd.nix ./services/logging/graylog.nix ./services/logging/heartbeat.nix diff --git a/nixos/modules/services/logging/filebeat.nix b/nixos/modules/services/logging/filebeat.nix new file mode 100644 index 000000000000..223a993c505b --- /dev/null +++ b/nixos/modules/services/logging/filebeat.nix @@ -0,0 +1,253 @@ +{ config, lib, utils, pkgs, ... }: + +let + inherit (lib) + attrValues + literalExpression + mkEnableOption + mkIf + mkOption + types; + + cfg = config.services.filebeat; + + json = pkgs.formats.json {}; +in +{ + options = { + + services.filebeat = { + + enable = mkEnableOption "filebeat"; + + package = mkOption { + type = types.package; + default = pkgs.filebeat; + defaultText = literalExpression "pkgs.filebeat"; + example = literalExpression "pkgs.filebeat7"; + description = '' + The filebeat package to use. + ''; + }; + + inputs = mkOption { + description = '' + Inputs specify how Filebeat locates and processes input data. + + This is like services.filebeat.settings.filebeat.inputs, + but structured as an attribute set. This has the benefit + that multiple NixOS modules can contribute settings to a + single filebeat input. + + An input type can be specified multiple times by choosing a + different <name> for each, but setting + + to the same value. + + See . + ''; + default = {}; + type = types.attrsOf (types.submodule ({ name, ... }: { + freeformType = json.type; + options = { + type = mkOption { + type = types.str; + default = name; + description = '' + The input type. + + Look for the value after type: on + the individual input pages linked from + . + ''; + }; + }; + })); + example = literalExpression '' + { + journald.id = "everything"; # Only for filebeat7 + log = { + enabled = true; + paths = [ + "/var/log/*.log" + ]; + }; + }; + ''; + }; + + modules = mkOption { + description = '' + Filebeat modules provide a quick way to get started + processing common log formats. They contain default + configurations, Elasticsearch ingest pipeline definitions, + and Kibana dashboards to help you implement and deploy a log + monitoring solution. + + This is like services.filebeat.settings.filebeat.modules, + but structured as an attribute set. This has the benefit + that multiple NixOS modules can contribute settings to a + single filebeat module. + + A module can be specified multiple times by choosing a + different <name> for each, but setting + + to the same value. + + See . + ''; + default = {}; + type = types.attrsOf (types.submodule ({ name, ... }: { + freeformType = json.type; + options = { + module = mkOption { + type = types.str; + default = name; + description = '' + The name of the module. + + Look for the value after module: on + the individual input pages linked from + . + ''; + }; + }; + })); + example = literalExpression '' + { + nginx = { + access = { + enabled = true; + var.paths = [ "/path/to/log/nginx/access.log*" ]; + }; + error = { + enabled = true; + var.paths = [ "/path/to/log/nginx/error.log*" ]; + }; + }; + }; + ''; + }; + + settings = mkOption { + type = types.submodule { + freeformType = json.type; + + options = { + + output.elasticsearch.hosts = mkOption { + type = with types; listOf str; + default = [ "127.0.0.1:9200" ]; + example = [ "myEShost:9200" ]; + description = '' + The list of Elasticsearch nodes to connect to. + + The events are distributed to these nodes in round + robin order. If one node becomes unreachable, the + event is automatically sent to another node. Each + Elasticsearch node can be defined as a URL or + IP:PORT. For example: + http://192.15.3.2, + https://es.found.io:9230 or + 192.24.3.2:9300. If no port is + specified, 9200 is used. + ''; + }; + + filebeat = { + inputs = mkOption { + type = types.listOf json.type; + default = []; + internal = true; + description = '' + Inputs specify how Filebeat locates and processes + input data. Use instead. + + See . + ''; + }; + modules = mkOption { + type = types.listOf json.type; + default = []; + internal = true; + description = '' + Filebeat modules provide a quick way to get started + processing common log formats. They contain default + configurations, Elasticsearch ingest pipeline + definitions, and Kibana dashboards to help you + implement and deploy a log monitoring solution. + + Use instead. + + See . + ''; + }; + }; + }; + }; + default = {}; + example = literalExpression '' + { + settings = { + output.elasticsearch = { + hosts = [ "myEShost:9200" ]; + username = "filebeat_internal"; + password = { _secret = "/var/keys/elasticsearch_password"; }; + }; + logging.level = "info"; + }; + }; + ''; + + description = '' + Configuration for filebeat. See + + for supported values. + + Options containing secret data should be set to an attribute + set containing the attribute _secret - a + string pointing to a file containing the value the option + should be set to. See the example to get a better picture of + this: in the resulting + filebeat.yml file, the + output.elasticsearch.password + key will be set to the contents of the + /var/keys/elasticsearch_password file. + ''; + }; + }; + }; + + config = mkIf cfg.enable { + + services.filebeat.settings.filebeat.inputs = attrValues cfg.inputs; + services.filebeat.settings.filebeat.modules = attrValues cfg.modules; + + systemd.services.filebeat = { + description = "Filebeat log shipper"; + wantedBy = [ "multi-user.target" ]; + wants = [ "elasticsearch.service" ]; + after = [ "elasticsearch.service" ]; + serviceConfig = { + ExecStartPre = pkgs.writeShellScript "filebeat-exec-pre" '' + set -euo pipefail + + umask u=rwx,g=,o= + + ${utils.genJqSecretsReplacementSnippet + cfg.settings + "/var/lib/filebeat/filebeat.yml" + } + ''; + ExecStart = '' + ${cfg.package}/bin/filebeat -e \ + -c "/var/lib/filebeat/filebeat.yml" \ + --path.data "/var/lib/filebeat" + ''; + Restart = "always"; + StateDirectory = "filebeat"; + }; + }; + }; +} diff --git a/nixos/tests/elk.nix b/nixos/tests/elk.nix index 8db49ecfb18a..f42be00f23b8 100644 --- a/nixos/tests/elk.nix +++ b/nixos/tests/elk.nix @@ -56,6 +56,23 @@ let ''); }; + filebeat = { + enable = elk ? filebeat; + package = elk.filebeat; + inputs.journald.id = "everything"; + + inputs.log = { + enabled = true; + paths = [ + "/var/lib/filebeat/test" + ]; + }; + + settings = { + logging.level = "info"; + }; + }; + metricbeat = { enable = true; package = elk.metricbeat; @@ -226,12 +243,27 @@ let one.wait_until_succeeds( expect_hits("Supercalifragilisticexpialidocious") ) + '' + lib.optionalString (elk ? filebeat) '' + with subtest( + "A message logged to the journal is ingested by elasticsearch via filebeat" + ): + one.wait_for_unit("filebeat.service") + one.execute("echo 'Superdupercalifragilisticexpialidocious' | systemd-cat") + one.wait_until_succeeds( + expect_hits("Superdupercalifragilisticexpialidocious") + ) + one.execute( + "echo 'SuperdupercalifragilisticexpialidociousIndeed' >> /var/lib/filebeat/test" + ) + one.wait_until_succeeds( + expect_hits("SuperdupercalifragilisticexpialidociousIndeed") + ) '' + '' with subtest("Elasticsearch-curator works"): one.systemctl("stop logstash") one.systemctl("start elasticsearch-curator") one.wait_until_succeeds( - '! curl --silent --show-error "${esUrl}/_cat/indices" | grep logstash | grep ^' + '! curl --silent --show-error --fail-with-body "${esUrl}/_cat/indices" | grep logstash | grep ^' ) ''; }) { inherit pkgs system; }; @@ -251,6 +283,7 @@ in { # elasticsearch = pkgs.elasticsearch7-oss; # logstash = pkgs.logstash7-oss; # kibana = pkgs.kibana7-oss; + # filebeat = pkgs.filebeat7; # metricbeat = pkgs.metricbeat7; # }; unfree = lib.dontRecurseIntoAttrs { @@ -265,6 +298,7 @@ in { elasticsearch = pkgs.elasticsearch7; logstash = pkgs.logstash7; kibana = pkgs.kibana7; + filebeat = pkgs.filebeat7; metricbeat = pkgs.metricbeat7; }; }; From 92b0427c6ce6c62b622c735032fa92b815eae16c Mon Sep 17 00:00:00 2001 From: talyz Date: Wed, 15 Dec 2021 19:57:30 +0100 Subject: [PATCH 16/26] python3Packages.parsedmarc.tests: Fix breakage - Don't use the deprecated elasticsearch7-oss package - Improve jq query robustness and add tracing (cherry picked from commit b38f44c8b7e0090c91199130e96ff79b485bda2d) --- nixos/tests/parsedmarc/default.nix | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/nixos/tests/parsedmarc/default.nix b/nixos/tests/parsedmarc/default.nix index d838d3b6a39c..50b977723e9c 100644 --- a/nixos/tests/parsedmarc/default.nix +++ b/nixos/tests/parsedmarc/default.nix @@ -4,6 +4,7 @@ { pkgs, ... }@args: let inherit (import ../../lib/testing-python.nix args) makeTest; + inherit (pkgs) lib; dmarcTestReport = builtins.fetchurl { name = "dmarc-test-report"; @@ -54,7 +55,7 @@ in localMail = makeTest { name = "parsedmarc-local-mail"; - meta = with pkgs.lib.maintainers; { + meta = with lib.maintainers; { maintainers = [ talyz ]; }; @@ -83,7 +84,7 @@ in }; }; - services.elasticsearch.package = pkgs.elasticsearch7-oss; + services.elasticsearch.package = pkgs.elasticsearch-oss; environment.systemPackages = [ (sendEmail "dmarc@localhost") @@ -94,6 +95,7 @@ in testScript = { nodes }: let esPort = toString nodes.parsedmarc.config.services.elasticsearch.port; + valueObject = lib.optionalString (lib.versionAtLeast nodes.parsedmarc.config.services.elasticsearch.package.version "7") ".value"; in '' parsedmarc.start() parsedmarc.wait_for_unit("postfix.service") @@ -104,11 +106,15 @@ in ) parsedmarc.fail( - "curl -sS -f http://localhost:${esPort}/_search?q=report_id:2940 | jq -e 'if .hits.total.value > 0 then true else null end'" + "curl -sS -f http://localhost:${esPort}/_search?q=report_id:2940" + + " | tee /dev/console" + + " | jq -es 'if . == [] then null else .[] | .hits.total${valueObject} > 0 end'" ) parsedmarc.succeed("send-email") parsedmarc.wait_until_succeeds( - "curl -sS -f http://localhost:${esPort}/_search?q=report_id:2940 | jq -e 'if .hits.total.value > 0 then true else null end'" + "curl -sS -f http://localhost:${esPort}/_search?q=report_id:2940" + + " | tee /dev/console" + + " | jq -es 'if . == [] then null else .[] | .hits.total${valueObject} > 0 end'" ) ''; }; @@ -121,7 +127,7 @@ in in makeTest { name = "parsedmarc-external-mail"; - meta = with pkgs.lib.maintainers; { + meta = with lib.maintainers; { maintainers = [ talyz ]; }; @@ -153,7 +159,7 @@ in }; }; - services.elasticsearch.package = pkgs.elasticsearch7-oss; + services.elasticsearch.package = pkgs.elasticsearch-oss; environment.systemPackages = [ pkgs.jq @@ -201,6 +207,7 @@ in testScript = { nodes }: let esPort = toString nodes.parsedmarc.config.services.elasticsearch.port; + valueObject = lib.optionalString (lib.versionAtLeast nodes.parsedmarc.config.services.elasticsearch.package.version "7") ".value"; in '' mail.start() mail.wait_for_unit("postfix.service") @@ -213,11 +220,15 @@ in ) parsedmarc.fail( - "curl -sS -f http://localhost:${esPort}/_search?q=report_id:2940 | jq -e 'if .hits.total.value > 0 then true else null end'" + "curl -sS -f http://localhost:${esPort}/_search?q=report_id:2940" + + " | tee /dev/console" + + " | jq -es 'if . == [] then null else .[] | .hits.total${valueObject} > 0 end'" ) mail.succeed("send-email") parsedmarc.wait_until_succeeds( - "curl -sS -f http://localhost:${esPort}/_search?q=report_id:2940 | jq -e 'if .hits.total.value > 0 then true else null end'" + "curl -sS -f http://localhost:${esPort}/_search?q=report_id:2940" + + " | tee /dev/console" + + " | jq -es 'if . == [] then null else .[] | .hits.total${valueObject} > 0 end'" ) ''; }; From d032da658bbd17dcf85a9504b9b942d665d0ba71 Mon Sep 17 00:00:00 2001 From: talyz Date: Thu, 16 Dec 2021 14:58:23 +0100 Subject: [PATCH 17/26] elk6: 6.8.3 -> 6.8.21 The latest version includes a fix for CVE-2021-44228. (cherry picked from commit b617526c2b807acebbc95f59affe2d54e66fa94e) --- pkgs/development/tools/misc/kibana/6.x.nix | 8 +++---- pkgs/misc/logging/beats/6.x.nix | 2 +- pkgs/servers/search/elasticsearch/6.x.nix | 4 ++-- pkgs/servers/search/elasticsearch/plugins.nix | 24 +++++++++---------- pkgs/tools/misc/logstash/6.x.nix | 4 ++-- pkgs/top-level/all-packages.nix | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pkgs/development/tools/misc/kibana/6.x.nix b/pkgs/development/tools/misc/kibana/6.x.nix index 9ba19c836b59..60f63bf61e64 100644 --- a/pkgs/development/tools/misc/kibana/6.x.nix +++ b/pkgs/development/tools/misc/kibana/6.x.nix @@ -18,12 +18,12 @@ let shas = if enableUnfree then { - x86_64-linux = "1xwklhqxk5rmdrgy2simwvijzq29kyq5w2w3hy53xh2i1zlnyvq3"; - x86_64-darwin = "1qpdn28mrpggd55khzqqld6r89l0hb870rigxcw2i8p2yx3jv106"; + x86_64-linux = "1a501lavxhckb3l93sbrbqyshicwkk6p89frry4x8p037xcfpy0x"; + x86_64-darwin = "0zm45af30shhcg3mdhcma6rms1hyrx62rm5jzwnz9kxv4d30skbw"; } else { - x86_64-linux = "1wpnwal2rq5v2bsp5qil9j6dplif7ql5394sy4ia5ghp2fzifxmf"; - x86_64-darwin = "12z8i0wbw10c097glbpdy350p0h3957433f51qfx2p0ghgkzkhzv"; + x86_64-linux = "0wfdipf21apyily7mvlqgyc7m5jpr96zgrryzwa854z3xb2vw8zg"; + x86_64-darwin = "1nklfx4yz6hsxlljvnvwjy7pncv9mzngl84710xad5jlyras3sdj"; }; in stdenv.mkDerivation rec { diff --git a/pkgs/misc/logging/beats/6.x.nix b/pkgs/misc/logging/beats/6.x.nix index 1808197498b5..f5e31924791b 100644 --- a/pkgs/misc/logging/beats/6.x.nix +++ b/pkgs/misc/logging/beats/6.x.nix @@ -8,7 +8,7 @@ let beat = package : extraArgs : buildGoPackage (rec { owner = "elastic"; repo = "beats"; rev = "v${version}"; - sha256 = "0jkiz5dfdi9zsji04ipcmcj7pml9294v455y7s2c22k24gyzbaw8"; + sha256 = "1vnw9clsc10cfpjf6vxvc6m507b2q17sgsl079iwqbp4v0286il7"; }; goPackagePath = "github.com/elastic/beats"; diff --git a/pkgs/servers/search/elasticsearch/6.x.nix b/pkgs/servers/search/elasticsearch/6.x.nix index 4b92592f65df..56f0779c833a 100644 --- a/pkgs/servers/search/elasticsearch/6.x.nix +++ b/pkgs/servers/search/elasticsearch/6.x.nix @@ -19,8 +19,8 @@ stdenv.mkDerivation (rec { url = "https://artifacts.elastic.co/downloads/elasticsearch/${pname}-${version}.tar.gz"; sha256 = if enableUnfree - then "09dy3iyzk460vra6na6vk7d3mzpbv4cl0pl7kjmybxy947j7hh42" - else "0s04xz3j4psyhawvy503sp2nl5s0gswmpd9wfvwnavgcrr23wk39"; + then "1hkcgqsrnnx3zjpgar4424mxfaxrx0zbrp7n7n0dlbhphshwnkmd" + else "1pglg60aigy31xmpfchnxcc04nd18zwc3av4m0kyp00yk5mnlyqm"; }; patches = [ ./es-home-6.x.patch ]; diff --git a/pkgs/servers/search/elasticsearch/plugins.nix b/pkgs/servers/search/elasticsearch/plugins.nix index baeeec5c67a7..03bb24d9a390 100644 --- a/pkgs/servers/search/elasticsearch/plugins.nix +++ b/pkgs/servers/search/elasticsearch/plugins.nix @@ -39,7 +39,7 @@ in url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/${pluginName}/${pluginName}-${version}.zip"; sha256 = if version == "7.16.1" then "1sz858m9963xqr5kzjlwnq7k0a146rn60v6xijyfbp8y3brg618p" - else if version == "6.8.3" then "0vbaqyj0lfy3ijl1c9h92b0nh605h5mjs57bk2zhycdvbw5sx2lv" + else if version == "6.8.21" then "06b1pavyggzfp4wwdql0q9nm3r7i9px9cagp4yh4nhxhnk4w5fiq" else throw "unsupported version ${version} for plugin ${pluginName}"; }; meta = with lib; { @@ -56,7 +56,7 @@ in url = "https://github.com/vhyza/elasticsearch-${pluginName}/releases/download/v${version}/elasticsearch-${pluginName}-${version}-plugin.zip"; sha256 = if version == "7.16.1" then "0yjy9yhw77lmalivxnmv2rq8fk93ddxszkk73lgmpffladx2ikir" - else if version == "6.8.3" then "12bshvp01pp2lgwd0cn9l58axg8gdimsh4g9wfllxi1bdpv4cy53" + else if version == "6.8.21" then "0m80cn7vkcvk95v4pdmi6vk5ww7p01k0hj2iqb9g870vs6x2qjzv" else throw "unsupported version ${version} for plugin ${pluginName}"; }; meta = with lib; { @@ -73,7 +73,7 @@ in url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/${pluginName}/${pluginName}-${version}.zip"; sha256 = if version == "7.16.1" then "1w5ndgffqzj5ijglmykifrk1jsgh7qwn8m7sbpiv0r7n3aayhz1x" - else if version == "6.8.3" then "0ggdhf7w50bxsffmcznrjy14b578fps0f8arg3v54qvj94v9jc37" + else if version == "6.8.21" then "07w8s4a5gvr9lzjzf629y8rx3kvs6zd1vl07ksw1paghp42yb354" else throw "unsupported version ${version} for plugin ${pluginName}"; }; meta = with lib; { @@ -90,7 +90,7 @@ in url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/${pluginName}/${pluginName}-${version}.zip"; sha256 = if version == "7.16.1" then "16mv7b9nl96bcygabvjqidxp2sjk340va19mrmliblpq3mxa2sii" - else if version == "6.8.3" then "0pmffz761dqjpvmkl7i7xsyw1iyyspqpddxp89rjsznfc9pak5im" + else if version == "6.8.21" then "1kdpbrasxwr3dn21zjrklp1s389rwa51fairygdwl8px9liwwfa5" else throw "unsupported version ${version} for plugin ${pluginName}"; }; meta = with lib; { @@ -107,7 +107,7 @@ in url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/${pluginName}/${pluginName}-${version}.zip"; sha256 = if version == "7.16.1" then "0bf8f8cybsp6s2ai3j04yay9kbhsafpgxivxjvzn2iy9qgc84ls4" - else if version == "6.8.3" then "0kfr4i2rcwinjn31xrc2piicasjanaqcgnbif9xc7lnak2nnzmll" + else if version == "6.8.21" then "0v31yyhjcdlqnjw1f9kihh7z3c6d31whc57hqqd1dn579n4s9rlz" else throw "unsupported version ${version} for plugin ${pluginName}"; }; meta = with lib; { @@ -124,7 +124,7 @@ in url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/${pluginName}/${pluginName}-${esVersion}.zip"; sha256 = if version == "7.16.1" then "0sfa0ql3hh8jmha230dyhr51bvsvwmazyycf36ngpmxsysm8ccml" - else if version == "6.8.3" then "1mm6hj2m1db68n81rzsvlw6nisflr5ikzk5zv9nmk0z641n5vh1x" + else if version == "6.8.21" then "0sfh1az30q4f34zxig2fz8wn9gk53fmmxyg5pbi1svn9761p5awq" else throw "unsupported version ${version} for plugin ${pluginName}"; }; meta = with lib; { @@ -141,7 +141,7 @@ in url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/${pluginName}/${pluginName}-${esVersion}.zip"; sha256 = if version == "7.16.1" then "1b95hjr4qhiavm7r7k19bwk5c64r00f1g5s0ydnb6gzym9hdb5s1" - else if version == "6.8.3" then "1s2klpvnhpkrk53p64zbga3b66czi7h1a13f58kfn2cn0zfavnbk" + else if version == "6.8.21" then "00lwj00rfdk6850gk1n86chiz2w6afpqn7jn588jdbwv41qh5mrv" else throw "unsupported version ${version} for plugin ${pluginName}"; }; meta = with lib; { @@ -158,7 +158,7 @@ in version = # https://docs.search-guard.com/latest/search-guard-versions if esVersion == "7.16.1" then "${esVersion}-52.5.0" - else if esVersion == "6.8.3" then "${esVersion}-25.5" + else if esVersion == "6.8.21" then "${esVersion}-25.6" else throw "unsupported version ${esVersion} for plugin ${pluginName}"; src = if esVersion == "7.16.1" then @@ -166,15 +166,15 @@ in url = "https://maven.search-guard.com/search-guard-suite-release/com/floragunn/search-guard-suite-plugin/${version}/search-guard-suite-plugin-${version}.zip"; sha256 = "1m3nj35qyrkkh3mhmn66nippavima8h8qpaxddalhjsvf70lhnjb"; } - else if esVersion == "6.8.3" then + else if esVersion == "6.8.21" then fetchurl { - url = "mirror://maven/com/floragunn/${pluginName}-${majorVersion}/${version}/${pluginName}-${majorVersion}-${version}.zip"; - sha256 = "0a7ys9qinc0fjyka03cx9rv0pm7wnvslk234zv5vrphkrj52s1cb"; + url = "https://maven.search-guard.com/search-guard-release/com/floragunn/search-guard-6/${version}/search-guard-6-${version}.zip"; + sha256 = "19nj513wigwd0mzq747zax4fzvv5vi24f7j0636rydd9iv9cyhg2"; } else throw "unsupported version ${version} for plugin ${pluginName}"; meta = with lib; { homepage = "https://search-guard.com"; - description = "Elasticsearch plugin that offers encryption, authentication, and authorisation. "; + description = "Elasticsearch plugin that offers encryption, authentication, and authorisation."; license = licenses.asl20; }; }; diff --git a/pkgs/tools/misc/logstash/6.x.nix b/pkgs/tools/misc/logstash/6.x.nix index 1c7ab29cbc86..7cd3c1c7e711 100644 --- a/pkgs/tools/misc/logstash/6.x.nix +++ b/pkgs/tools/misc/logstash/6.x.nix @@ -17,8 +17,8 @@ let this = stdenv.mkDerivation rec { url = "https://artifacts.elastic.co/downloads/logstash/${name}.tar.gz"; sha256 = if enableUnfree - then "00pwi7clgdflzzg15bh3y30gzikvvy7p5fl88fww7xhhy47q8053" - else "0spxgqsyh72n0l0xh6rljp0lbqz46xmr02sqz25ybycr4qkxdhgk"; + then "0hij1byw5b3xmk3vshr9p7gxwbjrywr7ylps05ydc2dmnz8q2a79" + else "1fa236pvhj7spys54nqi3k64rwzf6zi6gaccmqg4p4sh92jzsybv"; }; dontBuild = true; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bdd2c24727c4..254052c0838c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4918,7 +4918,7 @@ with pkgs; # The latest version used by elasticsearch, logstash, kibana and the the beats from elastic. # When updating make sure to update all plugins or they will break! - elk6Version = "6.8.3"; + elk6Version = "6.8.21"; elk7Version = "7.16.1"; elasticsearch6 = callPackage ../servers/search/elasticsearch/6.x.nix { From 82ecc368f4da1bf0331c4bc95285bb431d168ad6 Mon Sep 17 00:00:00 2001 From: talyz Date: Thu, 16 Dec 2021 17:19:39 +0100 Subject: [PATCH 18/26] rl-21.11: Note the addition of the filebeat service --- .../doc/manual/from_md/release-notes/rl-2111.section.xml | 8 ++++++++ nixos/doc/manual/release-notes/rl-2111.section.md | 2 ++ 2 files changed, 10 insertions(+) diff --git a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml index a64efa36e450..065198f123d9 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml @@ -541,6 +541,14 @@ services.prometheus.exporters.smartctl. + + + filebeat, + a lightweight shipper for forwarding and centralizing log + data. Available as + services.filebeat. + +
diff --git a/nixos/doc/manual/release-notes/rl-2111.section.md b/nixos/doc/manual/release-notes/rl-2111.section.md index 09c1b9590ed9..772c69a5d42c 100644 --- a/nixos/doc/manual/release-notes/rl-2111.section.md +++ b/nixos/doc/manual/release-notes/rl-2111.section.md @@ -149,6 +149,8 @@ In addition to numerous new and upgraded packages, this release has the followin - [smartctl_exporter](https://github.com/prometheus-community/smartctl_exporter), a Prometheus exporter for [S.M.A.R.T.](https://en.wikipedia.org/wiki/S.M.A.R.T.) data. Available as [services.prometheus.exporters.smartctl](options.html#opt-services.prometheus.exporters.smartctl.enable). +- [filebeat](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-overview.html), a lightweight shipper for forwarding and centralizing log data. Available as [services.filebeat](#opt-services.filebeat.enable). + ## Backward Incompatibilities {#sec-release-21.11-incompatibilities} - The NixOS VM test framework, `pkgs.nixosTest`/`make-test-python.nix`, now requires detaching commands such as `succeed("foo &")` and `succeed("foo | xclip -i")` to close stdout. From b80d20b6b68c62617e334e880d21ea2a2a9a11f5 Mon Sep 17 00:00:00 2001 From: JesusMtnez Date: Wed, 15 Dec 2021 10:27:59 +0100 Subject: [PATCH 19/26] sbt: 1.5.6 -> 1.5.7 (cherry picked from commit 92faf59b4417790f510022cc368f260280ab8677) --- pkgs/development/tools/build-managers/sbt/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/build-managers/sbt/default.nix b/pkgs/development/tools/build-managers/sbt/default.nix index eeb7fe56a79f..76855e670a95 100644 --- a/pkgs/development/tools/build-managers/sbt/default.nix +++ b/pkgs/development/tools/build-managers/sbt/default.nix @@ -8,11 +8,11 @@ stdenv.mkDerivation rec { pname = "sbt"; - version = "1.5.6"; + version = "1.5.7"; src = fetchurl { url = "https://github.com/sbt/sbt/releases/download/v${version}/sbt-${version}.tgz"; - sha256 = "sha256-PC0ndJkv4nNIdZMCtZhi3XRp/dRlXXx1yHvK8bAwIGg="; + sha256 = "sha256-6dnG02A0azpycsfdQOyh9GLewvezZl3s8esmIqWJfBk="; }; postPatch = '' From 464e152564c47b87233dbf1169123f02429e057b Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Tue, 14 Dec 2021 02:40:06 +0100 Subject: [PATCH 20/26] lib.systems.supported: remove aarch64-darwin from Tier 3 list While it is a fact of life that aarch64-darwin is built on Hydra, it has never formally been elevated from the Tier 7 state it was originally assigned in RFC 0046. Since platform Tier status is not only descriptive, but also normative, a consensus to commit to supporting aarch64-darwin would need to be reached. (cherry picked from commit 2d04319d0cba452a2dc00410b2afdbc18ede28b6) --- lib/systems/supported.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/systems/supported.nix b/lib/systems/supported.nix index ef429454f046..a1c038a5c8bc 100644 --- a/lib/systems/supported.nix +++ b/lib/systems/supported.nix @@ -4,7 +4,9 @@ { lib }: rec { # List of systems that are built by Hydra. - hydra = tier1 ++ tier2 ++ tier3; + hydra = tier1 ++ tier2 ++ tier3 ++ [ + "aarch64-darwin" + ]; tier1 = [ "x86_64-linux" @@ -16,7 +18,6 @@ rec { ]; tier3 = [ - "aarch64-darwin" "armv6l-linux" "armv7l-linux" "i686-linux" From d5422ba44752175e3e1746253ee8a6a6446c906e Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Mon, 13 Dec 2021 14:47:05 +0100 Subject: [PATCH 21/26] s6-man-pages: 2.11.0.0.2 -> 2.11.0.0.5 (cherry picked from commit c68820a676d997cd926e412e940ac0f70661cdfa) --- pkgs/data/documentation/s6-man-pages/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/data/documentation/s6-man-pages/default.nix b/pkgs/data/documentation/s6-man-pages/default.nix index d38df8cf0373..db4d05a91b04 100644 --- a/pkgs/data/documentation/s6-man-pages/default.nix +++ b/pkgs/data/documentation/s6-man-pages/default.nix @@ -2,8 +2,8 @@ buildManPages { pname = "s6-man-pages"; - version = "2.11.0.0.2"; - sha256 = "1ddab4l4wwrg2jdcrdqp1rx8dzbzbdsvx4mzayraxva4q97d1g9r"; + version = "2.11.0.0.5"; + sha256 = "03gl0vvdaqfb5hs0dfdbs9djxiyq3abcx9vwgkfw22b1rm2fa0r6"; description = "Port of the documentation for the s6 supervision suite to mdoc"; maintainers = [ lib.maintainers.sternenseemann ]; } From e1512ce318a38bc48aaf37c8e01732d09957a14d Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Mon, 13 Dec 2021 13:39:13 +0100 Subject: [PATCH 22/26] fcft: 2.5.0 -> 2.5.1 https://codeberg.org/dnkl/fcft/releases/tag/2.5.1 (cherry picked from commit 1db2304efad218f7746090c209a9eade8d10f6be) --- pkgs/development/libraries/fcft/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/fcft/default.nix b/pkgs/development/libraries/fcft/default.nix index 2101ee6dd42b..ae48dc56e27e 100644 --- a/pkgs/development/libraries/fcft/default.nix +++ b/pkgs/development/libraries/fcft/default.nix @@ -20,14 +20,14 @@ in stdenv.mkDerivation rec { pname = "fcft"; - version = "2.5.0"; + version = "2.5.1"; src = fetchFromGitea { domain = "codeberg.org"; owner = "dnkl"; repo = "fcft"; rev = version; - sha256 = "0agqldh68hn898d3f6k99kjbz8had5j5k0jyvi71d4k9vhx8cy7c"; + sha256 = "0dn0ic2ddi5qz6nqscsn7nlih67ad8vpclppbqwas6xavdfq6va2"; }; depsBuildBuild = [ pkg-config ]; From 35ed93a9573752ba02eb282d15e702fca5138072 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Mon, 13 Dec 2021 13:43:44 +0100 Subject: [PATCH 23/26] fcft: install documentation to separate outputs (cherry picked from commit 6ffc5e7005952e3f20e3641288e49f02f00c187b) --- pkgs/development/libraries/fcft/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/fcft/default.nix b/pkgs/development/libraries/fcft/default.nix index ae48dc56e27e..de20caf22fbc 100644 --- a/pkgs/development/libraries/fcft/default.nix +++ b/pkgs/development/libraries/fcft/default.nix @@ -44,6 +44,8 @@ stdenv.mkDerivation rec { doCheck = true; + outputs = [ "out" "doc" "man" ]; + passthru.tests = { noShaping = fcft.override { withShapingTypes = []; }; onlyGraphemeShaping = fcft.override { withShapingTypes = [ "grapheme" ]; }; From caa487ee7c64ed052596669323279398ff3ec911 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Mon, 13 Dec 2021 23:48:40 +0000 Subject: [PATCH 24/26] libtoxcore: 0.2.12 -> 0.2.13 (cherry picked from commit bbf825544e851927f7bb7a459b793d8bb84dadf4) --- pkgs/development/libraries/libtoxcore/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libtoxcore/default.nix b/pkgs/development/libraries/libtoxcore/default.nix index 4badf32fe8cc..10cc499d09d6 100644 --- a/pkgs/development/libraries/libtoxcore/default.nix +++ b/pkgs/development/libraries/libtoxcore/default.nix @@ -53,7 +53,7 @@ in { }; libtoxcore_0_2 = generic { - version = "0.2.12"; - sha256 = "0a6sqpm00d2rn0nviqfz4gh9ck1wzci6rxgmqmcyryl5ca19ffvp"; + version = "0.2.13"; + sha256 = "0a1cp00bnxl3q4l74yqp4aa6fg9slz4rg4lfzkl3khvmm6nzckds"; }; } From 169c7173a57069ad231c57418dbb29015018a879 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Thu, 16 Dec 2021 12:07:46 -0300 Subject: [PATCH 25/26] Revert "nixos-rebuild: switch to tmpDir during rebuilds" This seems to break `boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages` causing it to use `linuxPackages`. (cherry picked from commit e6ca3fc97641974be0810fbbba1ca1cc7b4d5396) --- pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh index 5874487a3d2d..244e1c1d52b1 100755 --- a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh +++ b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh @@ -362,16 +362,14 @@ if [ "$action" = edit ]; then exit 1 fi -ORIGIN_PWD="$PWD" + tmpDir=$(mktemp -t -d nixos-rebuild.XXXXXX) SSHOPTS="$NIX_SSHOPTS -o ControlMaster=auto -o ControlPath=$tmpDir/ssh-%n -o ControlPersist=60" -cd "$tmpDir" cleanup() { for ctrl in "$tmpDir"/ssh-*; do ssh -o ControlPath="$ctrl" -O exit dummyhost 2>/dev/null || true done - cd "$ORIGIN_PWD" rm -rf "$tmpDir" } trap cleanup EXIT From 71d967bb4f026131b8629755b15cc48100282d11 Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Thu, 16 Dec 2021 23:25:12 +0100 Subject: [PATCH 26/26] nixos/snapserver: use the correct bind address arguments Snapserver expects the arguments `--tcp.bind_to_address` and `--http.bind_to_address` instead of the `--tcp.address` (and http equivalent) versions. This caused the process to listen on `0.0.0.0` (for TCP and HTTP sockets) regardless of the configuration value. It also never listend on the IPv6 address `::` as our module system made the user believe. This commit fixes the above issue and ensures that (at least for the TCP socket) that our default `::` does indeed allow connections via IPv6 (to localhost aka ::1). (cherry picked from commit c9c93b0add8ab0ff054c83ba34174249564a8f3f) --- nixos/modules/services/audio/snapserver.nix | 4 ++-- nixos/tests/snapcast.nix | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/audio/snapserver.nix b/nixos/modules/services/audio/snapserver.nix index d3e97719f357..b82aca3976f0 100644 --- a/nixos/modules/services/audio/snapserver.nix +++ b/nixos/modules/services/audio/snapserver.nix @@ -54,12 +54,12 @@ let # tcp json rpc ++ [ "--tcp.enabled ${toString cfg.tcp.enable}" ] ++ optionals cfg.tcp.enable [ - "--tcp.address ${cfg.tcp.listenAddress}" + "--tcp.bind_to_address ${cfg.tcp.listenAddress}" "--tcp.port ${toString cfg.tcp.port}" ] # http json rpc ++ [ "--http.enabled ${toString cfg.http.enable}" ] ++ optionals cfg.http.enable [ - "--http.address ${cfg.http.listenAddress}" + "--http.bind_to_address ${cfg.http.listenAddress}" "--http.port ${toString cfg.http.port}" ] ++ optional (cfg.http.docRoot != null) "--http.doc_root \"${toString cfg.http.docRoot}\""); diff --git a/nixos/tests/snapcast.nix b/nixos/tests/snapcast.nix index 8d960b4cc069..30b8343e2ffe 100644 --- a/nixos/tests/snapcast.nix +++ b/nixos/tests/snapcast.nix @@ -40,6 +40,7 @@ in { }; }; }; + environment.systemPackages = [ pkgs.snapcast ]; }; client = { environment.systemPackages = [ pkgs.snapcast ]; @@ -71,6 +72,13 @@ in { "curl --fail http://localhost:${toString httpPort}/jsonrpc -d '{json.dumps(get_rpc_version)}'" ) + with subtest("test a ipv6 connection"): + server.execute("systemd-run --unit=snapcast-local-client snapclient -h ::1 -p ${toString port}") + server.wait_until_succeeds( + "journalctl -o cat -u snapserver.service | grep -q 'Hello from'" + ) + server.wait_until_succeeds("journalctl -o cat -u snapcast-local-client | grep -q 'buffer: ${toString bufferSize}'") + with subtest("test a connection"): client.execute("systemd-run --unit=snapcast-client snapclient -h server -p ${toString port}") server.wait_until_succeeds(