Unverified Commit d4b7361c authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt Committed by GitHub
Browse files

Merge pull request #311458 from TomaSajt/servers-toplevel-with

Remove usage of top-level `with lib;` from `pkgs/servers`
parents f36699f1 9f848675
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -7,8 +7,9 @@
, nixosTests
}:

with lib;

let
  inherit (lib) optional;
in
stdenv.mkDerivation rec {
  pname = "corosync";
  version = "3.1.8";
@@ -50,7 +51,7 @@ stdenv.mkDerivation rec {

  enableParallelBuilding = true;

  preConfigure = optionalString enableInfiniBandRdma ''
  preConfigure = lib.optionalString enableInfiniBandRdma ''
    # configure looks for the pkg-config files
    # of librdmacm and libibverbs
    # Howver, rmda-core does not provide a pkg-config file
@@ -70,7 +71,7 @@ stdenv.mkDerivation rec {
    inherit (nixosTests) pacemaker;
  };

  meta = {
  meta = with lib; {
    homepage = "http://corosync.org/";
    description = "Group Communication System with features for implementing high availability within applications";
    license = licenses.bsd3;
+7 −6
Original line number Diff line number Diff line
@@ -7,8 +7,9 @@
, ...
}:

with lib;

let
  inherit (lib) optional optionals optionalString;
in
stdenv.mkDerivation rec {
  version = "3.1.0";
  pname = "tengine";
@@ -22,9 +23,9 @@ stdenv.mkDerivation rec {

  buildInputs =
    [ openssl zlib pcre libxcrypt libxml2 libxslt gd geoip gperftools jemalloc ]
    ++ concatMap (mod: mod.inputs or []) modules;
    ++ lib.concatMap (mod: mod.inputs or []) modules;

  patches = singleton (substituteAll {
  patches = lib.singleton (substituteAll {
    src = ../nginx/nix-etag-1.15.4.patch;
    preInstall = ''
      export nixStoreDir="$NIX_STORE" nixStoreDirLen="''${#NIX_STORE}"
@@ -101,7 +102,7 @@ stdenv.mkDerivation rec {
  env.NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2 -Wno-error=implicit-fallthrough"
    + optionalString stdenv.isDarwin " -Wno-error=deprecated-declarations";

  preConfigure = (concatMapStringsSep "\n" (mod: mod.preConfigure or "") modules);
  preConfigure = (lib.concatMapStringsSep "\n" (mod: mod.preConfigure or "") modules);

  hardeningEnable = optional (!stdenv.isDarwin) "pie";

@@ -116,7 +117,7 @@ stdenv.mkDerivation rec {
    tests = nixosTests.nginx-variants.tengine;
  };

  meta = {
  meta = with lib; {
    description = "Web server based on Nginx and has many advanced features, originated by Taobao";
    mainProgram = "nginx";
    homepage    = "https://tengine.taobao.org";
+2 −3
Original line number Diff line number Diff line
@@ -12,8 +12,6 @@
, withDebug ? false
}:

with lib;

let
  phpConfig = {
    embedSupport = true;
@@ -27,6 +25,7 @@ let
  php81-unit = php81.override phpConfig;
  php82-unit = php82.override phpConfig;

  inherit (lib) optional optionals optionalString;
in stdenv.mkDerivation rec {
  version = "1.32.1";
  pname = "unit";
@@ -74,7 +73,7 @@ in stdenv.mkDerivation rec {

  passthru.tests.unit-php = nixosTests.unit-php;

  meta = {
  meta = with lib; {
    description = "Dynamic web and application server, designed to run applications in multiple languages";
    mainProgram = "unitd";
    homepage    = "https://unit.nginx.org/";
+1 −3
Original line number Diff line number Diff line
{ buildGoModule, fetchFromGitHub, lib  }:

with lib;

buildGoModule rec {
  pname   = "nats-streaming-server";
  version = "0.25.6";
@@ -18,7 +16,7 @@ buildGoModule rec {
  # tests fail and ask to `go install`
  doCheck = false;

  meta = {
  meta = with lib; {
    description = "NATS Streaming System Server";
    license = licenses.asl20;
    maintainers = [ maintainers.swdunlop ];
+7 −9
Original line number Diff line number Diff line
@@ -25,8 +25,6 @@
#   The command line administrative tools are part of other packages:
#   see pkgs.mongodb-tools and pkgs.mongosh.

with lib;

{ version, sha256, patches ? []
, license ? lib.licenses.sspl
, avxSupport ? stdenv.hostPlatform.avxSupport
@@ -39,7 +37,7 @@ let
    cheetah3
    psutil
    setuptools
  ] ++ lib.optionals (versionAtLeast version "6.0") [
  ] ++ lib.optionals (lib.versionAtLeast version "6.0") [
    packaging
    pymongo
  ]);
@@ -57,7 +55,7 @@ let
    #"stemmer"  -- not nice to package yet (no versioning, no makefile, no shared libs).
    #"valgrind" -- mongodb only requires valgrind.h, which is vendored in the source.
    #"wiredtiger"
  ] ++ optionals stdenv.isLinux [ "tcmalloc" ];
  ] ++ lib.optionals stdenv.isLinux [ "tcmalloc" ];
  inherit (lib) systems subtractLists;

in stdenv.mkDerivation rec {
@@ -108,7 +106,7 @@ in stdenv.mkDerivation rec {
    #include <string>'
    substituteInPlace src/mongo/db/exec/plan_stats.h --replace '#include <string>' '#include <optional>
    #include <string>'
  '' + lib.optionalString (stdenv.isDarwin && versionOlder version "6.0") ''
  '' + lib.optionalString (stdenv.isDarwin && lib.versionOlder version "6.0") ''
    substituteInPlace src/third_party/mozjs-${mozjsVersion}/extract/js/src/jsmath.cpp --replace '${mozjsReplace}' 0
  '' + lib.optionalString stdenv.isi686 ''

@@ -143,9 +141,9 @@ in stdenv.mkDerivation rec {
  preBuild = ''
    sconsFlags+=" CC=$CC"
    sconsFlags+=" CXX=$CXX"
  '' + optionalString (!stdenv.isDarwin) ''
  '' + lib.optionalString (!stdenv.isDarwin) ''
    sconsFlags+=" AR=$AR"
  '' + optionalString stdenv.isAarch64 ''
  '' + lib.optionalString stdenv.isAarch64 ''
    sconsFlags+=" CCFLAGS='-march=armv8-a+crc'"
  '';

@@ -165,7 +163,7 @@ in stdenv.mkDerivation rec {
  '';

  installTargets =
    if (versionAtLeast version "6.0") then "install-devcore"
    if (lib.versionAtLeast version "6.0") then "install-devcore"
    else "install-core";

  prefixKey = "DESTDIR=";
@@ -174,7 +172,7 @@ in stdenv.mkDerivation rec {

  hardeningEnable = [ "pie" ];

  meta = {
  meta = with lib; {
    description = "Scalable, high-performance, open source NoSQL database";
    homepage = "http://www.mongodb.org";
    inherit license;
Loading