From 95c29de58f50352a49c332e9b0bcb1c9fb4adb90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 2 Aug 2021 13:11:50 +0200 Subject: [PATCH 1/5] pivx: cleanup, format --- .../applications/blockchains/pivx/default.nix | 53 +++++++++++++------ pkgs/top-level/all-packages.nix | 3 ++ 2 files changed, 39 insertions(+), 17 deletions(-) diff --git a/pkgs/applications/blockchains/pivx/default.nix b/pkgs/applications/blockchains/pivx/default.nix index 58986a106763..fd562edf93f1 100644 --- a/pkgs/applications/blockchains/pivx/default.nix +++ b/pkgs/applications/blockchains/pivx/default.nix @@ -1,38 +1,57 @@ -{ fetchFromGitHub, lib, stdenv, pkg-config, autoreconfHook, wrapQtAppsHook ? null -, openssl, db48, boost, zlib, miniupnpc, gmp -, qrencode, glib, protobuf, yasm, libevent -, util-linux, qtbase ? null, qttools ? null +{ fetchFromGitHub +, lib +, stdenv +, pkg-config +, autoreconfHook +, wrapQtAppsHook +, openssl +, db48 +, boost +, zlib +, miniupnpc +, gmp +, qrencode +, glib +, protobuf +, yasm +, libevent +, util-linux +, qtbase +, qttools , enableUpnp ? false , disableWallet ? false , disableDaemon ? false -, withGui ? false }: +, withGui ? false +}: -with lib; stdenv.mkDerivation rec { - name = "pivx-${version}"; + pname = "pivx"; version = "4.1.1"; src = fetchFromGitHub { owner = "PIVX-Project"; - repo= "PIVX"; + repo = "PIVX"; rev = "v${version}"; sha256 = "03ndk46h6093v8s18d5iffz48zhlshq7jrk6vgpjfs6z2iqgd2sy"; }; - nativeBuildInputs = [ pkg-config autoreconfHook ] ++ optionals withGui [ wrapQtAppsHook ]; + nativeBuildInputs = [ pkg-config autoreconfHook ] + ++ lib.optionals withGui [ wrapQtAppsHook ]; + buildInputs = [ glib gmp openssl db48 yasm boost zlib libevent miniupnpc protobuf util-linux ] - ++ optionals withGui [ qtbase qttools qrencode ]; + ++ lib.optionals withGui [ qtbase qttools qrencode ]; configureFlags = [ "--with-boost-libdir=${boost.out}/lib" ] - ++ optional enableUpnp "--enable-upnp-default" - ++ optional disableWallet "--disable-wallet" - ++ optional disableDaemon "--disable-daemon" - ++ optionals withGui [ "--with-gui=yes" - "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin" - ]; + ++ lib.optional enableUpnp "--enable-upnp-default" + ++ lib.optional disableWallet "--disable-wallet" + ++ lib.optional disableDaemon "--disable-daemon" + ++ lib.optionals withGui [ + "--with-gui=yes" + "--with-qt-bindir=${lib.getDev qtbase}/bin:${lib.getDev qttools}/bin" + ]; enableParallelBuilding = true; - doChecks = true; + doCheck = true; postBuild = '' mkdir -p $out/share/applications $out/share/icons cp contrib/debian/pivx-qt.desktop $out/share/applications/ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f4799e5774c8..94f162769ba2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28786,6 +28786,9 @@ in pivx = libsForQt5.callPackage ../applications/blockchains/pivx { withGui = true; }; pivxd = callPackage ../applications/blockchains/pivx { withGui = false; + qtbase = null; + qttools = null; + wrapQtAppsHook = null; autoreconfHook = buildPackages.autoreconfHook269; }; From 76341deaabda66096f3711b33ee7eb5defe9a7bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 2 Aug 2021 13:12:04 +0200 Subject: [PATCH 2/5] grpc: format --- pkgs/development/libraries/grpc/default.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/grpc/default.nix b/pkgs/development/libraries/grpc/default.nix index 0b05126f3bb6..640136ec8b08 100644 --- a/pkgs/development/libraries/grpc/default.nix +++ b/pkgs/development/libraries/grpc/default.nix @@ -1,6 +1,18 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch, buildPackages -, cmake, zlib, c-ares, pkg-config, re2, openssl, protobuf, grpc -, abseil-cpp, libnsl +{ lib +, stdenv +, fetchFromGitHub +, fetchpatch +, buildPackages +, cmake +, zlib +, c-ares +, pkg-config +, re2 +, openssl +, protobuf +, grpc +, abseil-cpp +, libnsl }: stdenv.mkDerivation rec { From 0b06ccd7bec896d116d50c10d523c9be709abfbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 2 Aug 2021 13:12:10 +0200 Subject: [PATCH 3/5] knot-dns: cleanup --- pkgs/servers/dns/knot-dns/default.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkgs/servers/dns/knot-dns/default.nix b/pkgs/servers/dns/knot-dns/default.nix index fb4efba383c0..3e3bcaf1e001 100644 --- a/pkgs/servers/dns/knot-dns/default.nix +++ b/pkgs/servers/dns/knot-dns/default.nix @@ -3,8 +3,6 @@ , autoreconfHook, nixosTests }: -let inherit (lib) optional optionals; in - stdenv.mkDerivation rec { pname = "knot-dns"; version = "3.1.0"; @@ -39,12 +37,10 @@ stdenv.mkDerivation rec { libmnl # required for knot >= 3.1 # without sphinx &al. for developer documentation # TODO: add dnstap support? - ] - ++ optionals stdenv.isLinux [ - libcap_ng systemd - libbpf # XDP support - ] - ++ optional stdenv.isDarwin zlib; # perhaps due to gnutls + ] ++ lib.optionals stdenv.isLinux [ + libcap_ng systemd + libbpf # XDP support + ] ++ lib.optional stdenv.isDarwin zlib; # perhaps due to gnutls enableParallelBuilding = true; From 9733d7e0774cb8776184e33cda144c6914f84679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 2 Aug 2021 13:14:13 +0200 Subject: [PATCH 4/5] toxvpn: format, cleanup --- pkgs/tools/networking/toxvpn/default.nix | 35 ++++++++++++++---------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/pkgs/tools/networking/toxvpn/default.nix b/pkgs/tools/networking/toxvpn/default.nix index c433d7d0a668..c5aaec66d9e3 100644 --- a/pkgs/tools/networking/toxvpn/default.nix +++ b/pkgs/tools/networking/toxvpn/default.nix @@ -1,33 +1,40 @@ -{ lib, stdenv, fetchFromGitHub, cmake, nlohmann_json, - libtoxcore, libsodium, libcap, zeromq, - systemd ? null }: - -with lib; +{ lib +, stdenv +, fetchFromGitHub +, cmake +, nlohmann_json +, libtoxcore +, libsodium +, libcap +, zeromq +, systemd +}: stdenv.mkDerivation { - name = "toxvpn-2019-09-09"; + name = "toxvpn"; + version = "unstable-2019-09-09"; src = fetchFromGitHub { - owner = "cleverca22"; - repo = "toxvpn"; - rev = "45083dec172ce167f7ed84d571ec2822ebe4d51a"; + owner = "cleverca22"; + repo = "toxvpn"; + rev = "45083dec172ce167f7ed84d571ec2822ebe4d51a"; sha256 = "193crarrx6q0zd2p6dn67pzv8kngwi440zm1y54njgcz0v3fpxmb"; }; buildInputs = [ libtoxcore nlohmann_json libsodium zeromq ] - ++ optionals stdenv.isLinux [ libcap systemd ]; + ++ lib.optionals stdenv.isLinux [ libcap systemd ]; nativeBuildInputs = [ cmake ]; - cmakeFlags = optional stdenv.isLinux [ "-DSYSTEMD=1" ]; + cmakeFlags = lib.optional stdenv.isLinux [ "-DSYSTEMD=1" ]; postInstall = "$out/bin/toxvpn -h"; meta = with lib; { description = "A powerful tool that allows one to make tunneled point to point connections over Tox"; - homepage = "https://github.com/cleverca22/toxvpn"; - license = licenses.gpl3; + homepage = "https://github.com/cleverca22/toxvpn"; + license = licenses.gpl3; maintainers = with maintainers; [ cleverca22 obadz toonn ]; - platforms = platforms.linux ++ platforms.darwin; + platforms = platforms.unix; }; } From ae99f5aa96b91fe9d6ca9c5e115b410a033d3404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 2 Aug 2021 13:15:47 +0200 Subject: [PATCH 5/5] ssmtp: cleanup, format --- pkgs/tools/networking/ssmtp/default.nix | 31 ++++++++++++------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/pkgs/tools/networking/ssmtp/default.nix b/pkgs/tools/networking/ssmtp/default.nix index 6957d43e7913..ec309a4a2ce0 100644 --- a/pkgs/tools/networking/ssmtp/default.nix +++ b/pkgs/tools/networking/ssmtp/default.nix @@ -1,12 +1,11 @@ -{lib, stdenv, fetchurl, tlsSupport ? true, openssl ? null}: +{ lib, stdenv, fetchurl, tlsSupport ? true, openssl }: -assert tlsSupport -> openssl != null; - -stdenv.mkDerivation { - name = "ssmtp-2.64"; +stdenv.mkDerivation rec { + pname = "ssmtp"; + version = "2.64"; src = fetchurl { - url = "mirror://debian/pool/main/s/ssmtp/ssmtp_2.64.orig.tar.bz2"; + url = "mirror://debian/pool/main/s/ssmtp/ssmtp_${version}.orig.tar.bz2"; sha256 = "0dps8s87ag4g3jr6dk88hs9zl46h3790marc5c2qw7l71k4pvhr2"; }; @@ -19,16 +18,15 @@ stdenv.mkDerivation { (lib.enableFeature tlsSupport "ssl") ]; - postConfigure = - '' - # Don't run the script that interactively generates a config file. - # Also don't install the broken, cyclic symlink /lib/sendmail. - sed -e '/INSTALLED_CONFIGURATION_FILE/d' \ - -e 's|/lib/sendmail|$(TMPDIR)/sendmail|' \ - -i Makefile - substituteInPlace Makefile \ - --replace '$(INSTALL) -s' '$(INSTALL) -s --strip-program $(STRIP)' - ''; + postConfigure = '' + # Don't run the script that interactively generates a config file. + # Also don't install the broken, cyclic symlink /lib/sendmail. + sed -e '/INSTALLED_CONFIGURATION_FILE/d' \ + -e 's|/lib/sendmail|$(TMPDIR)/sendmail|' \ + -i Makefile + substituteInPlace Makefile \ + --replace '$(INSTALL) -s' '$(INSTALL) -s --strip-program $(STRIP)' + ''; installFlags = [ "etcdir=$(out)/etc" ]; @@ -39,6 +37,7 @@ stdenv.mkDerivation { NIX_LDFLAGS = lib.optionalString tlsSupport "-lcrypto"; meta = with lib; { + description = "simple MTA to deliver mail from a computer to a mail hub"; platforms = platforms.linux; license = licenses.gpl2; maintainers = with maintainers; [ basvandijk ];