diff --git a/pkgs/tools/networking/dae/default.nix b/pkgs/tools/networking/dae/default.nix index 1c1cf2a3fab4..57b1a817b0cb 100644 --- a/pkgs/tools/networking/dae/default.nix +++ b/pkgs/tools/networking/dae/default.nix @@ -1,7 +1,11 @@ { lib , clang , fetchFromGitHub +, symlinkJoin , buildGoModule +, makeWrapper +, v2ray-geoip +, v2ray-domain-list-community }: buildGoModule rec { pname = "dae"; @@ -19,7 +23,7 @@ buildGoModule rec { proxyVendor = true; - nativeBuildInputs = [ clang ]; + nativeBuildInputs = [ clang makeWrapper ]; ldflags = [ "-s" @@ -37,6 +41,19 @@ buildGoModule rec { # network required doCheck = false; + assetsDrv = symlinkJoin { + name = "dae-assets"; + paths = [ v2ray-geoip v2ray-domain-list-community ]; + }; + + postInstall = '' + install -Dm444 install/dae.service $out/lib/systemd/system/dae.service + wrapProgram $out/bin/dae \ + --suffix DAE_LOCATION_ASSET : $assetsDrv/share/v2ray + substituteInPlace $out/lib/systemd/system/dae.service \ + --replace /usr/bin/dae $out/bin/dae + ''; + meta = with lib; { description = "A Linux high-performance transparent proxy solution based on eBPF"; homepage = "https://github.com/daeuniverse/dae";