4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
50 lines
1.5 KiB
Nix
50 lines
1.5 KiB
Nix
{ stdenv, fetchFromGitHub, makeWrapper, lib
|
|
, dnsutils, coreutils, openssl, nettools, util-linux, procps }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "testssl.sh";
|
|
version = "3.0.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "drwetter";
|
|
repo = pname;
|
|
rev = version;
|
|
sha256 = "0vfpj3g3il3imbydx3j8gx1pgzrxi0czcl9jmi749vnkf5mkmh8w";
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
buildInputs = [
|
|
coreutils # for pwd and printf
|
|
dnsutils # for dig
|
|
nettools # for hostname
|
|
openssl # for openssl
|
|
procps # for ps
|
|
util-linux # for hexdump
|
|
];
|
|
|
|
postPatch = ''
|
|
substituteInPlace testssl.sh \
|
|
--replace /bin/pwd pwd \
|
|
--replace TESTSSL_INSTALL_DIR:-\"\" TESTSSL_INSTALL_DIR:-\"$out\" \
|
|
--replace PROG_NAME=\"\$\(basename\ \"\$0\"\)\" PROG_NAME=\"testssl.sh\"
|
|
'';
|
|
|
|
installPhase = ''
|
|
install -D testssl.sh $out/bin/testssl.sh
|
|
cp -r etc $out
|
|
|
|
wrapProgram $out/bin/testssl.sh --prefix PATH ':' ${lib.makeBinPath buildInputs}
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "CLI tool to check a server's TLS/SSL capabilities";
|
|
longDescription = ''
|
|
CLI tool which checks a server's service on any port for the support of
|
|
TLS/SSL ciphers, protocols as well as recent cryptographic flaws and more.
|
|
'';
|
|
homepage = "https://testssl.sh/";
|
|
license = licenses.gpl2;
|
|
maintainers = with maintainers; [ etu ];
|
|
};
|
|
}
|