1 { lib, stdenv, fetchFromGitHub, libcap, libev, libconfig, perl, tcp_wrappers, pcre2, nixosTests }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
11 hash = "sha256-+G6xYiytSWW2CljuaeJZfTuXCjkbDCzwU/FSLBmvnGw=";
14 postPatch = "patchShebangs *.sh";
16 buildInputs = [ libev libconfig perl pcre2 ] ++ lib.optionals stdenv.isLinux [ libcap tcp_wrappers ];
18 makeFlags = lib.optionals stdenv.isLinux [ "USELIBCAP=1" "USELIBWRAP=1" ];
21 # install all flavours
22 install -p sslh-fork "$out/sbin/sslh-fork"
23 install -p sslh-select "$out/sbin/sslh-select"
24 install -p sslh-ev "$out/sbin/sslh-ev"
25 ln -sf sslh-fork "$out/sbin/sslh"
28 installFlags = [ "PREFIX=$(out)" ];
30 hardeningDisable = [ "format" ];
33 inherit (nixosTests) sslh;
37 description = "Applicative Protocol Multiplexer (e.g. share SSH and HTTPS on the same port)";
38 license = licenses.gpl2Plus;
39 homepage = "https://www.rutschle.net/tech/sslh/README.html";
40 maintainers = with maintainers; [ koral fpletz ];
41 platforms = platforms.all;