mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
v2ray-rules-dat: use finalAttrs, modernize
(cherry picked from commit d41c971bce)
This commit is contained in:
parent
80598cf41f
commit
b0f28e8d48
1 changed files with 24 additions and 18 deletions
|
|
@ -1,37 +1,43 @@
|
|||
{
|
||||
lib,
|
||||
stdenvNoCC,
|
||||
fetchurl,
|
||||
lib,
|
||||
}:
|
||||
let
|
||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
pname = "v2ray-rules-dat";
|
||||
version = "202606122311";
|
||||
|
||||
geoipDat = fetchurl {
|
||||
url = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/download/${version}/geoip.dat";
|
||||
hash = "sha256-iGGpeUaWtIH7AEPueCssQOgL/Ia7nkLFvWnAj1SDsbU=";
|
||||
};
|
||||
|
||||
geositeDat = fetchurl {
|
||||
url = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/download/${version}/geosite.dat";
|
||||
hash = "sha256-/c/3OjfALveNnHS9NxonTeOiZyud6U/X4WHrGZSOs7Q=";
|
||||
};
|
||||
in
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "v2ray-rules-dat";
|
||||
inherit version;
|
||||
__structuredAttrs = true;
|
||||
strictDeps = true;
|
||||
|
||||
src = null;
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
install -Dm444 ${geoipDat} $out/share/v2ray/geoip.dat
|
||||
install -Dm444 ${geositeDat} $out/share/v2ray/geosite.dat
|
||||
runHook preInstall
|
||||
|
||||
install -Dm444 ${finalAttrs.passthru.geoipDat} $out/share/v2ray/geoip.dat
|
||||
install -Dm444 ${finalAttrs.passthru.geositeDat} $out/share/v2ray/geosite.dat
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
geoipDat = fetchurl {
|
||||
url = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/download/${finalAttrs.version}/geoip.dat";
|
||||
hash = "sha256-iGGpeUaWtIH7AEPueCssQOgL/Ia7nkLFvWnAj1SDsbU=";
|
||||
};
|
||||
geositeDat = fetchurl {
|
||||
url = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/download/${finalAttrs.version}/geosite.dat";
|
||||
hash = "sha256-/c/3OjfALveNnHS9NxonTeOiZyud6U/X4WHrGZSOs7Q=";
|
||||
};
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Enhanced edition of V2Ray rules dat files";
|
||||
homepage = "https://github.com/Loyalsoldier/v2ray-rules-dat";
|
||||
changelog = "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/tag/${finalAttrs.version}";
|
||||
license = lib.licenses.gpl3Only;
|
||||
maintainers = with lib.maintainers; [ nix-julia ];
|
||||
};
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue