From e2e42dcf178df48e2b44e8bcfb6767389074ad51 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Thu, 19 Aug 2021 18:25:45 +0000 Subject: [PATCH 01/20] vaultwarden: 1.22.1 -> 1.22.2 --- pkgs/tools/security/vaultwarden/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/security/vaultwarden/default.nix b/pkgs/tools/security/vaultwarden/default.nix index 4342c8f3ac95..eb4de54c303e 100644 --- a/pkgs/tools/security/vaultwarden/default.nix +++ b/pkgs/tools/security/vaultwarden/default.nix @@ -8,16 +8,16 @@ let in rustPlatform.buildRustPackage rec { pname = "vaultwarden"; - version = "1.22.1"; + version = "1.22.2"; src = fetchFromGitHub { owner = "dani-garcia"; repo = pname; rev = version; - sha256 = "sha256-aXbnNO3mTAgE1yNx7YVDo1vPpO8ACZpBGHQ633fNZ3k="; + sha256 = "sha256-37+Gor3xyo0yb3I4rrleJoPnqTA7G3WmeMSTltthi2E="; }; - cargoSha256 = "sha256-SFzq3OU0a0s3zlEzUkqGdZb/knYafqDamLy4ghH4i8I="; + cargoSha256 = "sha256-+zu5OfvXj8DMglf5Xv5ZcaUlbE03cwyD8TN7YftgWO0="; nativeBuildInputs = [ pkg-config ]; buildInputs = with lib; [ openssl ] From b012fe5e7ea86ef0f4de88ec80fa0e65113e1146 Mon Sep 17 00:00:00 2001 From: divanorama Date: Fri, 10 Sep 2021 19:12:32 +0200 Subject: [PATCH 02/20] use --verbatim-files-from in dockerTools https://www.gnu.org/software/tar/manual/html_node/files.html files starting with - can be treated as command line options, which isn't desirable here --- pkgs/build-support/docker/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix index 9e4709dd9bf8..4bda4d2a5c23 100644 --- a/pkgs/build-support/docker/default.nix +++ b/pkgs/build-support/docker/default.nix @@ -636,7 +636,7 @@ rec { <(sort -n layerFiles|uniq|grep -v ${layer}) -1 -3 > newFiles # Append the new files to the layer. tar -rpf temp/layer.tar --hard-dereference --sort=name --mtime="@$SOURCE_DATE_EPOCH" \ - --owner=0 --group=0 --no-recursion --files-from newFiles + --owner=0 --group=0 --no-recursion --verbatim-files-from --files-from newFiles echo "Adding meta..." From a75b1fa5a9df17fe30ad986aef53010400a1888c Mon Sep 17 00:00:00 2001 From: Karl Hallsby Date: Thu, 9 Sep 2021 21:29:39 -0500 Subject: [PATCH 03/20] octavePackages: add documentation --- doc/languages-frameworks/index.xml | 1 + doc/languages-frameworks/octave.section.md | 100 +++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 doc/languages-frameworks/octave.section.md diff --git a/doc/languages-frameworks/index.xml b/doc/languages-frameworks/index.xml index 49cdf94a44ab..29a1e089692f 100644 --- a/doc/languages-frameworks/index.xml +++ b/doc/languages-frameworks/index.xml @@ -24,6 +24,7 @@ + diff --git a/doc/languages-frameworks/octave.section.md b/doc/languages-frameworks/octave.section.md new file mode 100644 index 000000000000..ff872f4a7558 --- /dev/null +++ b/doc/languages-frameworks/octave.section.md @@ -0,0 +1,100 @@ +# Octave {#sec-octave} + +## Introduction {#ssec-octave-introduction} + +Octave is a modular scientific programming language and environment. +A majority of the packages supported by Octave from their [website](https://octave.sourceforge.io/packages.php) are packaged in nixpkgs. + +## Structure {#ssec-octave-structure} + +All Octave add-on packages are available in two ways: +1. Under the top-level `Octave` attribute, `octave.pkgs`. +2. As a top-level attribute, `octavePackages`. + +## Packaging Octave Packages {#ssec-octave-packaging} + +Nixpkgs provides a function `buildOctavePackage`, a generic package builder function for any Octave package that complies with the Octave's current packaging format. + +All Octave packages are defined in [pkgs/top-level/octave-packages.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/octave-packages.nix) rather than `pkgs/all-packages.nix`. +Each package is defined in their own file in the [pkgs/development/octave-modules](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/octave-modules) directory. +Octave packages are made available through `all-packages.nix` through both the attribute `octavePackages` and `octave.pkgs`. +You can test building an Octave package as follows: + +```ShellSession +$ nix-build -A octavePackages.symbolic +``` + +When building Octave packages with `nix-build`, the `buildOctavePackage` function adds `octave-octaveVersion` to; the start of the package's name attribute. + +This can be required when installing the package using `nix-env`: + +```ShellSession +$ nix-env -i octave-6.2.0-symbolic +``` + +Although, you can also install it using the attribute name: + +```ShellSession +$ nix-env -i -A octavePackages.symbolic +``` + +You can build Octave with packages by using the `withPackages` passed-through function. + +```ShellSession +$ nix-shell -p 'octave.withPackages (ps: with ps; [ symbolic ])' +``` + +This will also work in a `shell.nix` file. + +```nix +{ pkgs ? import { }}: + +pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + (octave.withPackages (opkgs: with opkgs; [ symbolic ])) + ]; +} +``` + +### `buildOctavePackage` Steps {#sssec-buildOctavePackage-steps} + +The `buildOctavePackage` does several things to make sure things work properly. + +1. Sets the environment variable `OCTAVE_HISTFILE` to `/dev/null` during package compilation so that the commands run through the Octave interpreter directly are not logged. +2. Skips the configuration step, because the packages are stored as gzipped tarballs, which Octave itself handles directly. +3. Change the hierarchy of the tarball so that only a single directory is at the top-most level of the tarball. +4. Use Octave itself to run the `pkg build` command, which unzips the tarball, extracts the necessary files written in Octave, and compiles any code written in C++ or Fortran, and places the fully compiled artifact in `$out`. + +`buildOctavePackage` is built on top of `stdenv` in a standard way, allowing most things to be customized. + +### Handling Dependencies {#sssec-octave-handling-dependencies} + +In Octave packages, there are four sets of dependencies that can be specified: + +`nativeBuildInputs` +: Just like other packages, `nativeBuildInputs` is intended for architecture-dependent build-time-only dependencies. + +`buildInputs` +: Like other packages, `buildInputs` is intended for architecture-independent build-time-only dependencies. + +`propagatedBuildInputs` +: Similar to other packages, `propagatedBuildInputs` is intended for packages that are required for both building and running of the package. +See [Symbolic](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/octave-modules/symbolic/default.nix) for how this works and why it is needed. + +`requiredOctavePackages` +: This is a special dependency that ensures the specified Octave packages are dependent on others, and are made available simultaneously when loading them in Octave. + +### Installing Octave Packages {#sssec-installing-octave-packages} + +By default, the `buildOctavePackage` function does _not_ install the requested package into Octave for use. +The function will only build the requested package. +This is due to Octave maintaining an text-based database about which packages are installed where. +To this end, when all the requested packages have been built, the Octave package and all its add-on packages are put together into an environment, similar to Python. + +1. First, all the Octave binaries are wrapped with the environment variable `OCTAVE_SITE_INITFILE` set to a file in `$out`, which is required for Octave to be able to find the non-standard package database location. +2. Because of the way `buildEnv` works, all tarballs that are present (which should be all Octave packages to install) should be removed. +3. The path down to the default install location of Octave packages is recreated so that Nix-operated Octave can install the packages. +4. Install the packages into the `$out` environment while writing package entries to the database file. +This database file is unique for each different (according to Nix) environment invocation. +5. Rewrite the Octave-wide startup file to read from the list of packages installed in that particular environment. +6. Wrap any programs that are required by the Octave packages so that they work with all the paths defined within the environment. From d7f0ec1d46ce788efa74393d4b5d9886ad8a269d Mon Sep 17 00:00:00 2001 From: Eric Dallo Date: Tue, 14 Sep 2021 11:26:21 -0300 Subject: [PATCH 04/20] clojure-lsp: Add updateScript --- .../tools/misc/clojure-lsp/default.nix | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/misc/clojure-lsp/default.nix b/pkgs/development/tools/misc/clojure-lsp/default.nix index fee8f89aac2d..a2527e6dd310 100644 --- a/pkgs/development/tools/misc/clojure-lsp/default.nix +++ b/pkgs/development/tools/misc/clojure-lsp/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, graalvm11-ce, babashka, fetchurl, fetchFromGitHub, clojure }: +{ lib, stdenv, graalvm11-ce, babashka, fetchurl, fetchFromGitHub, clojure, writeScript }: stdenv.mkDerivation rec { pname = "clojure-lsp"; @@ -12,7 +12,8 @@ stdenv.mkDerivation rec { }; jar = fetchurl { - url = "https://github.com/clojure-lsp/clojure-lsp/releases/download/${version}/clojure-lsp.jar"; + url = + "https://github.com/clojure-lsp/clojure-lsp/releases/download/${version}/clojure-lsp.jar"; sha256 = "0ahrlqzyz3mgfx8w9w49172pb3dipq0hwwzk2yasqzcp1fi6jm80"; }; @@ -49,6 +50,27 @@ stdenv.mkDerivation rec { runHook postCheck ''; + passthru.updateScript = writeScript "update-clojure-lsp" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p curl common-updater-scripts + + set -eu -o pipefail + + latest_version=$(curl -s https://api.github.com/repos/clojure-lsp/clojure-lsp/releases/latest | jq --raw-output .tag_name) + + old_jar_hash=$(nix-instantiate --eval --strict -A "clojure-lsp.jar.drvAttrs.outputHash" | tr -d '"' | sed -re 's|[+]|\\&|g') + + curl -o clojure-lsp.jar -sL https://github.com/clojure-lsp/clojure-lsp/releases/download/$latest_version/clojure-lsp.jar + new_jar_hash=$(nix-hash --flat --type sha256 clojure-lsp.jar | sed -re 's|[+]|\\&|g') + + rm -f clojure-lsp.jar + + nixFile=$(nix-instantiate --eval --strict -A "clojure-lsp.meta.position" | sed -re 's/^"(.*):[0-9]+"$/\1/') + + sed -i "$nixFile" -re "s|\"$old_jar_hash\"|\"$new_jar_hash\"|" + update-source-version clojure-lsp "$latest_version" + ''; + meta = with lib; { description = "Language Server Protocol (LSP) for Clojure"; homepage = "https://github.com/clojure-lsp/clojure-lsp"; From ff7905256c42067aa89714afd873fae25b6965a1 Mon Sep 17 00:00:00 2001 From: Eric Dallo Date: Tue, 14 Sep 2021 11:26:50 -0300 Subject: [PATCH 05/20] clojure-lsp: 2021.09.04-17.11.44 -> 2021.09.13-22.25.35 --- pkgs/development/tools/misc/clojure-lsp/default.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkgs/development/tools/misc/clojure-lsp/default.nix b/pkgs/development/tools/misc/clojure-lsp/default.nix index a2527e6dd310..2f523d86247f 100644 --- a/pkgs/development/tools/misc/clojure-lsp/default.nix +++ b/pkgs/development/tools/misc/clojure-lsp/default.nix @@ -2,19 +2,18 @@ stdenv.mkDerivation rec { pname = "clojure-lsp"; - version = "2021.09.04-17.11.44"; + version = "2021.09.13-22.25.35"; src = fetchFromGitHub { owner = pname; repo = pname; rev = version; - sha256 = "1i12vxg3yb1051q7j6yqlsdy4lc4xl7n4lqssp8w634fpx1p0rgv"; + sha256 = "0ypn0m81lbhx45y0ajpgk7id9g47l1gnihvqdjxw5m1j2hdwjdzr"; }; jar = fetchurl { - url = - "https://github.com/clojure-lsp/clojure-lsp/releases/download/${version}/clojure-lsp.jar"; - sha256 = "0ahrlqzyz3mgfx8w9w49172pb3dipq0hwwzk2yasqzcp1fi6jm80"; + url = "https://github.com/clojure-lsp/clojure-lsp/releases/download/${version}/clojure-lsp.jar"; + sha256 = "e93e334a4ada04a28e0b148b8364b9433b8d83f6417249d7bded7cc86d1fe081"; }; GRAALVM_HOME = graalvm11-ce; @@ -52,7 +51,7 @@ stdenv.mkDerivation rec { passthru.updateScript = writeScript "update-clojure-lsp" '' #!/usr/bin/env nix-shell - #!nix-shell -i bash -p curl common-updater-scripts + #!nix-shell -i bash -p curl common-updater-scripts gnused jq nix set -eu -o pipefail From ab1ec682ac4e8af4617e191e5ac75d3ba5015620 Mon Sep 17 00:00:00 2001 From: Ryan Burns Date: Fri, 17 Sep 2021 18:45:35 -0700 Subject: [PATCH 06/20] opencv3: fix build --- pkgs/development/libraries/opencv/3.x.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix index fcc6238500f1..dfb67b6a12a7 100644 --- a/pkgs/development/libraries/opencv/3.x.nix +++ b/pkgs/development/libraries/opencv/3.x.nix @@ -1,5 +1,6 @@ { lib, stdenv , fetchFromGitHub +, fetchpatch , cmake, pkg-config, unzip, zlib, pcre, hdf5 , glog, boost, gflags, protobuf , config @@ -154,6 +155,11 @@ stdenv.mkDerivation { # Ensures that we use the system OpenEXR rather than the vendored copy of the source included with OpenCV. patches = [ ./cmake-don-t-use-OpenCVFindOpenEXR.patch + # Fix usage of deprecated version of protobuf' SetTotalBytesLimit. Remove with the next release. + (fetchpatch { + url = "https://github.com/opencv/opencv/commit/384875f4fcf1782b10699a379aa245a03cb27a04.patch"; + sha256 = "1agwd0pm07m2dy8a62vmfl4n73dsmsdll2a73q6kara9wm3jlp41"; + }) ]; # This prevents cmake from using libraries in impure paths (which From b23afbb86657833f7027f6aed9aae5ea219346ae Mon Sep 17 00:00:00 2001 From: Ryan Burns Date: Sun, 19 Sep 2021 02:31:26 -0700 Subject: [PATCH 07/20] Revert "csdp: move gfortran to nativeBuildInputs" We are not using gfortran as a native binary; we are using its lib. Fixes build on darwin. This reverts commit eabbf45b60bd9b36b3cc87f97232f2aa83e97a56. --- pkgs/applications/science/math/csdp/default.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/applications/science/math/csdp/default.nix b/pkgs/applications/science/math/csdp/default.nix index d1bfc2c020a8..02c4c134f92e 100644 --- a/pkgs/applications/science/math/csdp/default.nix +++ b/pkgs/applications/science/math/csdp/default.nix @@ -8,9 +8,7 @@ stdenv.mkDerivation { sha256 = "1f9ql6cjy2gwiyc51ylfan24v1ca9sjajxkbhszlds1lqmma8n05"; }; - nativeBuildInputs = [ gfortran ]; - - buildInputs = [ blas lapack ]; + buildInputs = [ blas gfortran.cc.lib lapack ]; postPatch = '' substituteInPlace Makefile --replace /usr/local/bin $out/bin From 879de382a6a086a33e2df931e681a84c76032b7d Mon Sep 17 00:00:00 2001 From: Ryan Burns Date: Sun, 19 Sep 2021 11:34:48 -0700 Subject: [PATCH 08/20] kwin: fix build against libglvnd 1.3.4+ https://hydra.nixos.org/build/153586964 https://bugs.kde.org/show_bug.cgi?id=440372 https://invent.kde.org/plasma/kwin/-/merge_requests/1404 https://invent.kde.org/plasma/kwin/-/merge_requests/1420 --- pkgs/desktops/plasma-5/kwin/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/desktops/plasma-5/kwin/default.nix b/pkgs/desktops/plasma-5/kwin/default.nix index e6e49a591810..c650f4ef83df 100644 --- a/pkgs/desktops/plasma-5/kwin/default.nix +++ b/pkgs/desktops/plasma-5/kwin/default.nix @@ -40,6 +40,18 @@ mkDerivation { ./0002-xwayland.patch ./0003-plugins-qpa-allow-using-nixos-wrapper.patch ./0001-NixOS-Unwrap-executable-name-for-.desktop-search.patch + # Fix build against libglvnd 1.3.4+ + # Remove with release 5.22.90 + (fetchpatch { + url = "https://invent.kde.org/plasma/kwin/-/commit/839710201c389b7f4ed248cb3818e755a37ce977.patch"; + sha256 = "09rldhy0sbmqdfpyjzwm20cwnmrmj0w2751vyi5xlr414g0rzyc1"; + }) + # Fixup previous patch for i686 + # Remove with release 5.22.90 + (fetchpatch { + url = "https://invent.kde.org/plasma/kwin/-/commit/38e24ecd6416a975db0989c21b70d6a4cc242f35.patch"; + sha256 = "0zsjmzswcnvfd2jm1c8i9aijpbap1141mjv6y4j282bplyqlp966"; + }) ]; CXXFLAGS = [ ''-DNIXPKGS_XWAYLAND=\"${lib.getBin xwayland}/bin/Xwayland\"'' From e253005922e824df12573a141e58c053db9ecd15 Mon Sep 17 00:00:00 2001 From: superherointj <5861043+superherointj@users.noreply.github.com> Date: Sun, 19 Sep 2021 16:57:37 -0300 Subject: [PATCH 09/20] linkerd_edge: 21.8.2 -> 21.9.3 --- pkgs/applications/networking/cluster/linkerd/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/cluster/linkerd/default.nix b/pkgs/applications/networking/cluster/linkerd/default.nix index da77ffad3afc..6d5d5d1bd4a3 100644 --- a/pkgs/applications/networking/cluster/linkerd/default.nix +++ b/pkgs/applications/networking/cluster/linkerd/default.nix @@ -64,8 +64,8 @@ in }; edge = generic { channel = "edge"; - version = "21.8.2"; - sha256 = "sha256-jMYJ/mLWvuje4ZRuRbzMaqhz8kyn1bYGITJxkyw5Fyg="; - vendorSha256 = "sha256-18QB2GOxHfnP4GQaF0aohY5kEOg0xN/c+Sp33Ww/1uQ="; + version = "21.9.3"; + sha256 = "0swqx4myvr24visj39icg8g90kj325pvf22bq447rnm0whq3cnyz"; + vendorSha256 = "sha256-fMtAR66TwMNR/HCVQ9Jg3sJ0XBx2jUKDG7/ts0lEZM4="; }; } From 811fe35a665fa47cf88c97e9e6aa395526d3a9b6 Mon Sep 17 00:00:00 2001 From: Oleksii Filonenko Date: Tue, 7 Apr 2020 11:43:33 +0300 Subject: [PATCH 10/20] nixos/meilisearch: init Reviewed-by: Aaron Andersen (cherry picked from commit 5844ea85c3ad96b8a2df9da50374c530e86a904d) --- nixos/modules/module-list.nix | 1 + nixos/modules/services/search/meilisearch.nix | 83 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 nixos/modules/services/search/meilisearch.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index b07b30c8c3e0..c356fc56a0eb 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -899,6 +899,7 @@ ./services/search/elasticsearch-curator.nix ./services/search/hound.nix ./services/search/kibana.nix + ./services/search/meilisearch.nix ./services/search/solr.nix ./services/security/certmgr.nix ./services/security/cfssl.nix diff --git a/nixos/modules/services/search/meilisearch.nix b/nixos/modules/services/search/meilisearch.nix new file mode 100644 index 000000000000..f8205fe550ad --- /dev/null +++ b/nixos/modules/services/search/meilisearch.nix @@ -0,0 +1,83 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.meilisearch; + +in { + + meta.maintainers = with maintainers; [ filalex77 ]; + + ###### interface + + options.services.meilisearch = { + enable = mkEnableOption "MeiliSearch - a RESTful search API"; + + listenAddress = mkOption { + description = "MeiliSearch listen address."; + default = "127.0.0.1"; + type = types.str; + }; + + listenPort = mkOption { + description = "MeiliSearch port to listen on."; + default = 7700; + type = types.port; + }; + + environment = mkOption { + description = "Defines the running environment of MeiliSearch."; + default = "development"; + type = types.enum [ "development" "production" ]; + }; + + masterKeyFile = mkOption { + description = '' + Path to file which contains the master key. + By doing so, all routes will be protected and will require a key to be accessed. + If no master key is provided, all routes can be accessed without requiring any key. + ''; + default = null; + type = with types; nullOr path; + }; + + noAnalytics = mkOption { + description = '' + Deactivates analytics. + Analytics allow MeiliSearch to know how many users are using MeiliSearch, + which versions and which platforms are used. + This process is entirely anonymous. + ''; + default = false; + type = types.bool; + }; + + }; + + ###### implementation + + config = mkIf cfg.enable { + systemd.services.meilisearch = { + description = "MeiliSearch daemon"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + environment = let + masterKey = mkIf (cfg.masterKeyFile != null) (builtins.readFile cfg.masterKeyFile); + in { + MEILI_DB_PATH = "/var/lib/meilisearch"; + MEILI_HTTP_ADDR = "${cfg.listenAddress}:${toString cfg.listenPort}"; + MEILI_MASTER_KEY = masterKey; + MEILI_NO_ANALYTICS = toString cfg.noAnalytics; + MEILI_ENV = cfg.environment; + }; + serviceConfig = { + ExecStart = "${pkgs.meilisearch}/bin/meilisearch"; + DynamicUser = true; + StateDirectory = "meilisearch"; + }; + }; + + environment.systemPackages = [ pkgs.meilisearch ]; + }; +} From be72fadd548864f60fbb69dcb3d3b389ec79979c Mon Sep 17 00:00:00 2001 From: Oleksii Filonenko Date: Tue, 7 Apr 2020 12:00:43 +0300 Subject: [PATCH 11/20] nixosTests.meilisearch: init (cherry picked from commit 4cc2d55f6ac2440843ef3387909dbc703f65397d) --- nixos/tests/all-tests.nix | 1 + nixos/tests/meilisearch.nix | 60 +++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 nixos/tests/meilisearch.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 52b8b9a70483..325caba07ea3 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -250,6 +250,7 @@ in matrix-appservice-irc = handleTest ./matrix-appservice-irc.nix {}; matrix-synapse = handleTest ./matrix-synapse.nix {}; mediawiki = handleTest ./mediawiki.nix {}; + meilisearch = handleTest ./meilisearch.nix {}; memcached = handleTest ./memcached.nix {}; metabase = handleTest ./metabase.nix {}; minecraft = handleTest ./minecraft.nix {}; diff --git a/nixos/tests/meilisearch.nix b/nixos/tests/meilisearch.nix new file mode 100644 index 000000000000..ef5781458ffd --- /dev/null +++ b/nixos/tests/meilisearch.nix @@ -0,0 +1,60 @@ +import ./make-test-python.nix ({ pkgs, lib, ... }: + let + listenAddress = "127.0.0.1"; + listenPort = 7700; + apiUrl = "http://${listenAddress}:${toString listenPort}"; + uid = "movies"; + indexJSON = pkgs.writeText "index.json" (builtins.toJSON { inherit uid; }); + moviesJSON = pkgs.runCommand "movies.json" {} '' + sed -n '1,5p;$p' ${pkgs.meilisearch.src}/datasets/movies/movies.json > $out + ''; + in { + name = "meilisearch"; + meta.maintainers = with lib.maintainers; [ filalex77 ]; + + machine = { ... }: { + environment.systemPackages = with pkgs; [ curl jq ]; + services.meilisearch = { + enable = true; + inherit listenAddress listenPort; + }; + }; + + testScript = '' + import json + + start_all() + + machine.wait_for_unit("meilisearch") + machine.wait_for_open_port("7700") + + with subtest("check version"): + version = json.loads(machine.succeed("curl ${apiUrl}/version")) + assert version["pkgVersion"] == "${pkgs.meilisearch.version}" + + with subtest("create index"): + machine.succeed( + "curl -XPOST ${apiUrl}/indexes --data @${indexJSON}" + ) + indexes = json.loads(machine.succeed("curl ${apiUrl}/indexes")) + assert len(indexes) == 1, "index wasn't created" + + with subtest("add documents"): + response = json.loads( + machine.succeed( + "curl -XPOST ${apiUrl}/indexes/${uid}/documents --data @${moviesJSON}" + ) + ) + update_id = response["updateId"] + machine.wait_until_succeeds( + f"curl ${apiUrl}/indexes/${uid}/updates/{update_id} | jq -e '.status == \"processed\"'" + ) + + with subtest("search"): + response = json.loads( + machine.succeed("curl ${apiUrl}/indexes/movies/search?q=hero") + ) + print(response) + assert len(response["hits"]) >= 1, "no results found" + ''; + }) From 6903737a8cab8e572ab28799377a28dd3785efa9 Mon Sep 17 00:00:00 2001 From: happysalada Date: Wed, 8 Sep 2021 14:53:40 +0900 Subject: [PATCH 12/20] meilisearch: nixpkgs-fmt --- nixos/modules/services/search/meilisearch.nix | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/nixos/modules/services/search/meilisearch.nix b/nixos/modules/services/search/meilisearch.nix index f8205fe550ad..9245bf68935a 100644 --- a/nixos/modules/services/search/meilisearch.nix +++ b/nixos/modules/services/search/meilisearch.nix @@ -5,7 +5,8 @@ with lib; let cfg = config.services.meilisearch; -in { +in +{ meta.maintainers = with maintainers; [ filalex77 ]; @@ -56,21 +57,23 @@ in { }; ###### implementation - + config = mkIf cfg.enable { systemd.services.meilisearch = { description = "MeiliSearch daemon"; wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; - environment = let - masterKey = mkIf (cfg.masterKeyFile != null) (builtins.readFile cfg.masterKeyFile); - in { - MEILI_DB_PATH = "/var/lib/meilisearch"; - MEILI_HTTP_ADDR = "${cfg.listenAddress}:${toString cfg.listenPort}"; - MEILI_MASTER_KEY = masterKey; - MEILI_NO_ANALYTICS = toString cfg.noAnalytics; - MEILI_ENV = cfg.environment; - }; + environment = + let + masterKey = mkIf (cfg.masterKeyFile != null) (builtins.readFile cfg.masterKeyFile); + in + { + MEILI_DB_PATH = "/var/lib/meilisearch"; + MEILI_HTTP_ADDR = "${cfg.listenAddress}:${toString cfg.listenPort}"; + MEILI_MASTER_KEY = masterKey; + MEILI_NO_ANALYTICS = toString cfg.noAnalytics; + MEILI_ENV = cfg.environment; + }; serviceConfig = { ExecStart = "${pkgs.meilisearch}/bin/meilisearch"; DynamicUser = true; From bdd04deff52fd6eb0d34e08ac8193ddb96c84a96 Mon Sep 17 00:00:00 2001 From: happysalada Date: Tue, 14 Sep 2021 20:27:11 +0900 Subject: [PATCH 13/20] meilisearch: module cleanup --- nixos/modules/services/search/meilisearch.nix | 75 +++++++++++++++---- 1 file changed, 59 insertions(+), 16 deletions(-) diff --git a/nixos/modules/services/search/meilisearch.nix b/nixos/modules/services/search/meilisearch.nix index 9245bf68935a..913a885993ca 100644 --- a/nixos/modules/services/search/meilisearch.nix +++ b/nixos/modules/services/search/meilisearch.nix @@ -15,6 +15,13 @@ in options.services.meilisearch = { enable = mkEnableOption "MeiliSearch - a RESTful search API"; + package = mkOption { + description = "The package to use for meilisearch. Use this if you require specific features to be enabled. The default package has no features."; + default = pkgs.meilisearch; + defaultText = "pkgs.meilisearch"; + type = types.package; + }; + listenAddress = mkOption { description = "MeiliSearch listen address."; default = "127.0.0.1"; @@ -33,11 +40,14 @@ in type = types.enum [ "development" "production" ]; }; - masterKeyFile = mkOption { + # TODO change this to LoadCredentials once possible + masterKeyEnvironmentFile = mkOption { description = '' Path to file which contains the master key. By doing so, all routes will be protected and will require a key to be accessed. If no master key is provided, all routes can be accessed without requiring any key. + The format is the following: + MEILI_MASTER_KEY=my_secret_key ''; default = null; type = with types; nullOr path; @@ -50,10 +60,46 @@ in which versions and which platforms are used. This process is entirely anonymous. ''; - default = false; + default = true; type = types.bool; }; + logLevel = mkOption { + description = '' + Defines how much detail should be present in MeiliSearch's logs. + MeiliSearch currently supports four log levels, listed in order of increasing verbosity: + - 'ERROR': only log unexpected events indicating MeiliSearch is not functioning as expected + - 'WARN:' log all unexpected events, regardless of their severity + - 'INFO:' log all events. This is the default value + - 'DEBUG': log all events and including detailed information on MeiliSearch's internal processes. + Useful when diagnosing issues and debugging + ''; + default = "INFO"; + type = types.str; + }; + + maxIndexSize = mkOption { + description = '' + Sets the maximum size of the index. + Value must be given in bytes or explicitly stating a base unit. + For example, the default value can be written as 107374182400, '107.7Gb', or '107374 Mb'. + Default is 100 GiB + ''; + default = "107374182400"; + type = types.str; + }; + + payloadSizeLimit = mkOption { + description = '' + Sets the maximum size of accepted JSON payloads. + Value must be given in bytes or explicitly stating a base unit. + For example, the default value can be written as 107374182400, '107.7Gb', or '107374 Mb'. + Default is ~ 100 MB + ''; + default = "104857600"; + type = types.str; + }; + }; ###### implementation @@ -63,24 +109,21 @@ in description = "MeiliSearch daemon"; wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; - environment = - let - masterKey = mkIf (cfg.masterKeyFile != null) (builtins.readFile cfg.masterKeyFile); - in - { - MEILI_DB_PATH = "/var/lib/meilisearch"; - MEILI_HTTP_ADDR = "${cfg.listenAddress}:${toString cfg.listenPort}"; - MEILI_MASTER_KEY = masterKey; - MEILI_NO_ANALYTICS = toString cfg.noAnalytics; - MEILI_ENV = cfg.environment; - }; + environment = { + MEILI_DB_PATH = "/var/lib/meilisearch"; + MEILI_HTTP_ADDR = "${cfg.listenAddress}:${toString cfg.listenPort}"; + MEILI_NO_ANALYTICS = toString cfg.noAnalytics; + MEILI_ENV = cfg.environment; + MEILI_DUMPS_DIR = "/var/lib/meilisearch/dumps"; + MEILI_LOG_LEVEL = cfg.logLevel; + MEILI_MAX_INDEX_SIZE = cfg.maxIndexSize; + }; serviceConfig = { - ExecStart = "${pkgs.meilisearch}/bin/meilisearch"; + ExecStart = "${cfg.package}/bin/meilisearch"; DynamicUser = true; StateDirectory = "meilisearch"; + EnvironmentFile = mkIf (cfg.masterKeyEnvironmentFile != null) cfg.masterKeyEnvironmentFile; }; }; - - environment.systemPackages = [ pkgs.meilisearch ]; }; } From 86682241081f7e291b8df454f60c0200b7f26050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 18 Sep 2021 18:47:35 +0200 Subject: [PATCH 14/20] libsixel: 1.8.6 -> 1.10.1 - Switched to maintained fork of libsixel - Linked CVEs were fixed in 1.10.1 --- .../libraries/libsixel/default.nix | 50 ++++++++++++++----- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/pkgs/development/libraries/libsixel/default.nix b/pkgs/development/libraries/libsixel/default.nix index 0d5a54f9693e..549f4385fa56 100644 --- a/pkgs/development/libraries/libsixel/default.nix +++ b/pkgs/development/libraries/libsixel/default.nix @@ -1,30 +1,56 @@ -{lib, stdenv, fetchFromGitHub}: +{ lib +, stdenv +, fetchFromGitHub +, meson +, ninja +, libbsd +, gdk-pixbuf +, gd +, libjpeg +, pkg-config +, fetchpatch +}: stdenv.mkDerivation rec { - version = "1.8.6"; pname = "libsixel"; + version = "1.10.1"; src = fetchFromGitHub { + owner = "libsixel"; repo = "libsixel"; rev = "v${version}"; - owner = "saitoha"; - sha256 = "1saxdj6sldv01g6w6yk8vr7px4bl31xca3a82j6v1j3fw5rbfphy"; + sha256 = "sha256-ACypJTFjXSzBjo4hQzUiJOqnaRaZnYX+/NublN9sbBo="; }; - configureFlags = [ - "--enable-tests" + patches = [ + (fetchpatch { + url = "https://github.com/libsixel/libsixel/commit/4d3e53ee007f3b71f638875f9fabbba658b2ca8a.patch"; + sha256 = "sha256-iDfsTyUczjtzV3pt1ZErbhVO2rMm2ZYKWSBl+ru+5HA="; + }) + ]; + + buildInputs = [ + libbsd gdk-pixbuf gd + ]; + + nativeBuildInputs = [ + meson ninja pkg-config ]; doCheck = true; + mesonFlags = [ + "-Dtests=enabled" + # build system seems to be broken here, it still seems to handle jpeg + # through some other ways. + "-Djpeg=disabled" + "-Dpng=disabled" + ]; + meta = with lib; { description = "The SIXEL library for console graphics, and converter programs"; - homepage = "http://saitoha.github.com/libsixel"; + homepage = "https://github.com/libsixel/libsixel"; maintainers = with maintainers; [ vrthra ]; license = licenses.mit; - platforms = with platforms; unix; - knownVulnerabilities = [ - "CVE-2020-11721" # https://github.com/saitoha/libsixel/issues/134 - "CVE-2020-19668" # https://github.com/saitoha/libsixel/issues/136 - ]; + platforms = platforms.unix; }; } From 173a24fc5c9df0f3d6c09c7fdcbb6e940b3f7127 Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 8 Aug 2021 20:09:29 -0400 Subject: [PATCH 15/20] notcurses: 2.3.8 -> 2.4.1 Co-authored-by: Bobby Rong --- pkgs/development/libraries/notcurses/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/notcurses/default.nix b/pkgs/development/libraries/notcurses/default.nix index a99a09a0fe69..6d12ed6ef1bd 100644 --- a/pkgs/development/libraries/notcurses/default.nix +++ b/pkgs/development/libraries/notcurses/default.nix @@ -4,6 +4,7 @@ , pandoc , libunistring , ncurses +, zlib , ffmpeg , readline , fetchFromGitHub @@ -13,20 +14,20 @@ stdenv.mkDerivation rec { pname = "notcurses"; - version = "2.3.8"; + version = "2.4.1"; src = fetchFromGitHub { owner = "dankamongmen"; repo = "notcurses"; rev = "v${version}"; - sha256 = "sha256-CTMFXTmOnBUCm0KdVNBoDT08arr01XTHdELFiTayk3E="; + sha256 = "sha256-Oyjdmmb+rqPgkwVJw3y4NKGPABmCZFyGFBzBJn6IEHk="; }; outputs = [ "out" "dev" ]; nativeBuildInputs = [ cmake pkg-config pandoc ]; - buildInputs = [ libunistring ncurses readline ] + buildInputs = [ libunistring ncurses readline zlib ] ++ lib.optional multimediaSupport ffmpeg; cmakeFlags = [ "-DUSE_QRCODEGEN=OFF" ] From 00a66c45e59ad9fa5cc7a37c31fc0245c09cb630 Mon Sep 17 00:00:00 2001 From: Jim Garrison Date: Mon, 20 Sep 2021 04:37:30 -0400 Subject: [PATCH 16/20] capnproto: update homepage and correct license See MIT License at https://github.com/capnproto/capnproto/blob/master/LICENSE --- pkgs/development/libraries/capnproto/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/capnproto/default.nix b/pkgs/development/libraries/capnproto/default.nix index a27a54b1eacb..3e5a22bf4c86 100644 --- a/pkgs/development/libraries/capnproto/default.nix +++ b/pkgs/development/libraries/capnproto/default.nix @@ -10,14 +10,14 @@ stdenv.mkDerivation rec { }; meta = with lib; { - homepage = "http://kentonv.github.io/capnproto"; + homepage = "https://capnproto.org/"; description = "Cap'n Proto cerealization protocol"; longDescription = '' Cap’n Proto is an insanely fast data interchange format and capability-based RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster. ''; - license = licenses.bsd2; + license = licenses.mit; platforms = platforms.all; maintainers = with maintainers; [ cstrahan ]; }; From 20291381c1e79eda0d5efbf3470440f270a7dee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Zimmermann?= Date: Tue, 7 Sep 2021 14:44:40 +0200 Subject: [PATCH 17/20] coqPackages.mkCoqDerivation: rely on namePrefix to compute default opam-name As suggested by Cyril Cohen in https://github.com/NixOS/nixpkgs/pull/134362#discussion_r698379405. --- doc/languages-frameworks/coq.section.md | 4 ++-- pkgs/build-support/coq/default.nix | 5 ++--- pkgs/development/coq-modules/multinomials/default.nix | 1 - 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/doc/languages-frameworks/coq.section.md b/doc/languages-frameworks/coq.section.md index 39b60d83ac7d..a5155aedaf52 100644 --- a/doc/languages-frameworks/coq.section.md +++ b/doc/languages-frameworks/coq.section.md @@ -28,12 +28,12 @@ The recommended way of defining a derivation for a Coq library, is to use the `c * `domain` (optional, defaults to `"github.com"`), domains including the strings `"github"` or `"gitlab"` in their names are automatically supported, otherwise, one must change the `fetcher` argument to support them (cf `pkgs/development/coq-modules/heq/default.nix` for an example), * `releaseRev` (optional, defaults to `(v: v)`), provides a default mapping from release names to revision hashes/branch names/tags, * `displayVersion` (optional), provides a way to alter the computation of `name` from `pname`, by explaining how to display version numbers, -* `namePrefix` (optional), provides a way to alter the computation of `name` from `pname`, by explaining which dependencies must occur in `name`, +* `namePrefix` (optional, defaults to `[ "coq" ]`), provides a way to alter the computation of `name` from `pname`, by explaining which dependencies must occur in `name`, * `extraBuildInputs` (optional), by default `buildInputs` just contains `coq`, this allows to add more build inputs, * `mlPlugin` (optional, defaults to `false`). Some extensions (plugins) might require OCaml and sometimes other OCaml packages. Standard dependencies can be added by setting the current option to `true`. For a finer grain control, the `coq.ocamlPackages` attribute can be used in `extraBuildInputs` to depend on the same package set Coq was built against. * `useDune2ifVersion` (optional, default to `(x: false)` uses Dune2 to build the package if the provided predicate evaluates to true on the version, e.g. `useDune2if = versions.isGe "1.1"` will use dune if the version of the package is greater or equal to `"1.1"`, * `useDune2` (optional, defaults to `false`) uses Dune2 to build the package if set to true, the presence of this attribute overrides the behavior of the previous one. -* `opam-name` (optional, defaults to `coq-` followed by the value of `pname`), name of the Dune package to build. +* `opam-name` (optional, defaults to concatenating with a dash separator the components of `namePrefix` and `pname`), name of the Dune package to build. * `enableParallelBuilding` (optional, defaults to `true`), since it is activated by default, we provide a way to disable it. * `extraInstallFlags` (optional), allows to extend `installFlags` which initializes the variable `COQMF_COQLIB` so as to install in the proper subdirectory. Indeed Coq libraries should be installed in `$(out)/lib/coq/${coq.coq-version}/user-contrib/`. Such directories are automatically added to the `$COQPATH` environment variable by the hook defined in the Coq derivation. * `setCOQBIN` (optional, defaults to `true`), by default, the environment variable `$COQBIN` is set to the current Coq's binary, but one can disable this behavior by setting it to `false`, diff --git a/pkgs/build-support/coq/default.nix b/pkgs/build-support/coq/default.nix index 05f6e7762a07..569b07cded63 100644 --- a/pkgs/build-support/coq/default.nix +++ b/pkgs/build-support/coq/default.nix @@ -16,7 +16,7 @@ in displayVersion ? {}, release ? {}, extraBuildInputs ? [], - namePrefix ? [], + namePrefix ? [ "coq" ], enableParallelBuilding ? true, extraInstallFlags ? [], setCOQBIN ? true, @@ -27,7 +27,7 @@ in dropDerivationAttrs ? [], useDune2ifVersion ? (x: false), useDune2 ? false, - opam-name ? "coq-${pname}", + opam-name ? (concatStringsSep "-" (namePrefix ++ [ pname ])), ... }@args: let @@ -44,7 +44,6 @@ let location = { inherit domain owner repo; }; } // optionalAttrs (args?fetcher) {inherit fetcher;}); fetched = fetch (if !isNull version then version else defaultVersion); - namePrefix = args.namePrefix or [ "coq" ]; display-pkg = n: sep: v: let d = displayVersion.${n} or (if sep == "" then ".." else true); in n + optionalString (v != "" && v != null) (switch d [ diff --git a/pkgs/development/coq-modules/multinomials/default.nix b/pkgs/development/coq-modules/multinomials/default.nix index acbb602a54ef..f806d764755d 100644 --- a/pkgs/development/coq-modules/multinomials/default.nix +++ b/pkgs/development/coq-modules/multinomials/default.nix @@ -4,7 +4,6 @@ with lib; mkCoqDerivation { namePrefix = [ "coq" "mathcomp" ]; pname = "multinomials"; - opam-name = "coq-mathcomp-multinomials"; owner = "math-comp"; From bac5fde048203c8cd5f1f5445f38757383223f4d Mon Sep 17 00:00:00 2001 From: Atemu Date: Mon, 20 Sep 2021 10:50:53 +0200 Subject: [PATCH 18/20] yt-dlp: add option to install a youtube-dl alias youtube-dl development seems to have stalled and yt-dlp is the de-facto upstream nowadays. This provides an easy way to use yt-dlp as a drop-in replacement: youtube-dl = yt-dlp.override { withAlias = true; }; --- pkgs/tools/misc/yt-dlp/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/tools/misc/yt-dlp/default.nix b/pkgs/tools/misc/yt-dlp/default.nix index e2c90ef05308..40af80a4606d 100644 --- a/pkgs/tools/misc/yt-dlp/default.nix +++ b/pkgs/tools/misc/yt-dlp/default.nix @@ -12,6 +12,7 @@ , rtmpSupport ? true , phantomjsSupport ? false , hlsEncryptedSupport ? true +, withAlias ? false # Provides bin/youtube-dl for backcompat }: buildPythonPackage rec { @@ -50,6 +51,10 @@ buildPythonPackage rec { # Requires network doCheck = false; + postInstall = lib.optionalString withAlias '' + ln -s "$out/bin/yt-dlp" "$out/bin/youtube-dl" + ''; + meta = with lib; { homepage = "https://github.com/yt-dlp/yt-dlp/"; description = "Command-line tool to download videos from YouTube.com and other sites (youtube-dl fork)"; From 78c2be85d7cce69491894bafa819d5592e1c8b92 Mon Sep 17 00:00:00 2001 From: "Zak B. Elep" Date: Mon, 20 Sep 2021 17:57:09 +0800 Subject: [PATCH 19/20] rubyPackages.ansi: init at 1.5.0 (#138240) --- pkgs/development/ruby-modules/with-packages/Gemfile | 1 + pkgs/top-level/ruby-packages.nix | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/pkgs/development/ruby-modules/with-packages/Gemfile b/pkgs/development/ruby-modules/with-packages/Gemfile index 401fa3c66b0f..a476912cdd7f 100644 --- a/pkgs/development/ruby-modules/with-packages/Gemfile +++ b/pkgs/development/ruby-modules/with-packages/Gemfile @@ -1,5 +1,6 @@ source 'https://rubygems.org' do gem 'addressable' + gem 'ansi' gem 'atk' gem 'awesome_print' gem 'bacon' diff --git a/pkgs/top-level/ruby-packages.nix b/pkgs/top-level/ruby-packages.nix index 3ced3d8e4c37..e37c9e277afb 100644 --- a/pkgs/top-level/ruby-packages.nix +++ b/pkgs/top-level/ruby-packages.nix @@ -130,6 +130,16 @@ }; version = "2.4.0"; }; + ansi = { + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "14ims9zfal4gs2wpx2m5rd8zsrl2k794d359shkrsgg3fhr2a22l"; + type = "gem"; + }; + version = "1.5.0"; + }; ast = { groups = ["default"]; platforms = []; From 0695f657678893d9cca657491a46c68a2adcf541 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 20 Sep 2021 13:18:20 +0200 Subject: [PATCH 20/20] whsniff: specify license --- pkgs/applications/networking/sniffers/whsniff/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/networking/sniffers/whsniff/default.nix b/pkgs/applications/networking/sniffers/whsniff/default.nix index 6674808e91ba..514336e7a6b9 100644 --- a/pkgs/applications/networking/sniffers/whsniff/default.nix +++ b/pkgs/applications/networking/sniffers/whsniff/default.nix @@ -20,6 +20,6 @@ stdenv.mkDerivation rec { description = "Packet sniffer for 802.15.4 wireless networks"; maintainers = with maintainers; [ snicket2100 ]; platforms = platforms.linux; - license = licenses.gpl2; + license = licenses.gpl2Only; }; }