2024-01-13 08:15:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, libcap, libev, libconfig, perl, tcp_wrappers, pcre2, nixosTests }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "sslh";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2.1.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-22 15:38:15 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "yrutschle";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-NCjLqYSPHukY11URQ/n+33Atzl4DhPDbNOEDaP6bQlg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = "patchShebangs *.sh";
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
buildInputs = [ libev libconfig perl pcre2 ] ++ lib.optionals stdenv.isLinux [ libcap tcp_wrappers ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
makeFlags = lib.optionals stdenv.isLinux [ "USELIBCAP=1" "USELIBWRAP=1" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
postInstall = ''
|
|
|
|
# install all flavours
|
|
|
|
install -p sslh-fork "$out/sbin/sslh-fork"
|
|
|
|
install -p sslh-select "$out/sbin/sslh-select"
|
|
|
|
install -p sslh-ev "$out/sbin/sslh-ev"
|
|
|
|
ln -sf sslh-fork "$out/sbin/sslh"
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) sslh;
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Applicative Protocol Multiplexer (e.g. share SSH and HTTPS on the same port)";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
homepage = "https://www.rutschle.net/tech/sslh/README.html";
|
|
|
|
maintainers = with maintainers; [ koral fpletz ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|