at 24.11-pre 1.6 kB view raw
1{ lib, stdenv, fetchFromGitHub, cmake, gtest, c-ares, curl, libev }: 2 3let 4 # https-dns-proxy supports HTTP3 if curl has support, but as of 2022-08 curl doesn't work with that enabled 5 # curl' = (curl.override { http3Support = true; }); 6 curl' = curl; 7 8in 9stdenv.mkDerivation rec { 10 pname = "https-dns-proxy"; 11 # there are no stable releases (yet?) 12 version = "unstable-2022-05-05"; 13 14 src = fetchFromGitHub { 15 owner = "aarond10"; 16 repo = "https_dns_proxy"; 17 rev = "d310a378795790350703673388821558163944de"; 18 hash = "sha256-On4SKUeltPhzM/x+K9aKciKBw5lmVySxnmLi2tnKr3Y="; 19 }; 20 21 postPatch = '' 22 substituteInPlace https_dns_proxy.service.in \ 23 --replace "\''${CMAKE_INSTALL_PREFIX}/" "" 24 substituteInPlace munin/https_dns_proxy.plugin \ 25 --replace '--unit https_dns_proxy.service' '--unit https-dns-proxy.service' 26 ''; 27 28 nativeBuildInputs = [ cmake gtest ]; 29 30 buildInputs = [ c-ares curl' libev ]; 31 32 postInstall = '' 33 install -Dm444 -t $out/share/doc/${pname} ../{LICENSE,*.md} 34 install -Dm444 -t $out/share/${pname}/munin ../munin/* 35 # the systemd service definition is garbage, and we use our own with NixOS 36 mv $out/lib/systemd $out/share/${pname} 37 rmdir $out/lib 38 ''; 39 40 # upstream wants to add tests and the gtest framework is in place, so be ready 41 # for when that happens despite there being none as of right now 42 doCheck = true; 43 44 meta = with lib; { 45 description = "DNS to DNS over HTTPS (DoH) proxy"; 46 license = licenses.mit; 47 maintainers = with maintainers; [ peterhoeg ]; 48 platforms = platforms.linux; 49 mainProgram = "https_dns_proxy"; 50 }; 51}