35 lines
1.1 KiB
Nix
35 lines
1.1 KiB
Nix
{ stdenv, pkgsBuildBuild, fetchFromGitHub, lib }:
|
|
|
|
let
|
|
generator = pkgsBuildBuild.buildGoModule rec {
|
|
pname = "v2ray-domain-list-community";
|
|
version = "20221130032508";
|
|
src = fetchFromGitHub {
|
|
owner = "v2fly";
|
|
repo = "domain-list-community";
|
|
rev = version;
|
|
sha256 = "sha256-1UkP88HGh0KBYaekskeQHkJh02veUYmATKJD/wy4erc=";
|
|
};
|
|
vendorSha256 = "sha256-CCY3CgjA1w4svzmkaI2Jt272Rrt5UOt5sbVDAWRRfzk=";
|
|
meta = with lib; {
|
|
description = "community managed domain list";
|
|
homepage = "https://github.com/v2fly/domain-list-community";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ nickcao ];
|
|
};
|
|
};
|
|
in
|
|
stdenv.mkDerivation {
|
|
inherit (generator) pname version src meta;
|
|
buildPhase = ''
|
|
runHook preBuild
|
|
${generator}/bin/domain-list-community -datapath $src/data --exportlists=category-ads-all,tld-cn,cn,tld-\!cn,geolocation-\!cn,apple,icloud
|
|
runHook postBuild
|
|
'';
|
|
installPhase = ''
|
|
runHook preInstall
|
|
install -Dm644 dlc.dat $out/share/v2ray/geosite.dat
|
|
runHook postInstall
|
|
'';
|
|
passthru.generator = generator;
|
|
}
|