Merge pull request #281360 from Guanran928/clash

clash-{nyanpasu,verge-rev}: init
This commit is contained in:
Weijia Wang 2024-03-10 23:32:25 +01:00 committed by GitHub
commit ad272aadc4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 54 additions and 7 deletions

View File

@ -7427,6 +7427,12 @@
githubId = 21156405;
name = "GuangTao Zhang";
};
Guanran928 = {
email = "guanran928@outlook.com";
github = "Guanran928";
githubId = 68757440;
name = "Guanran928";
};
guekka = {
github = "Guekka";
githubId = 39066502;

View File

@ -3,6 +3,7 @@
{
options.programs.clash-verge = {
enable = lib.mkEnableOption (lib.mdDoc "Clash Verge");
package = lib.mkPackageOption pkgs "clash-verge" {};
autoStart = lib.mkEnableOption (lib.mdDoc "Clash Verge auto launch");
tunMode = lib.mkEnableOption (lib.mdDoc "Clash Verge TUN mode");
};
@ -14,10 +15,10 @@
lib.mkIf cfg.enable {
environment.systemPackages = [
pkgs.clash-verge
cfg.package
(lib.mkIf cfg.autoStart (pkgs.makeAutostartItem {
name = "clash-verge";
package = pkgs.clash-verge;
package = cfg.package;
}))
];
@ -25,7 +26,7 @@
owner = "root";
group = "root";
capabilities = "cap_net_bind_service,cap_net_admin=+ep";
source = "${lib.getExe pkgs.clash-verge}";
source = "${lib.getExe cfg.package}";
};
};

View File

@ -0,0 +1,23 @@
{ lib
, clash-verge
, mihomo
, fetchurl
}:
(clash-verge.override {
clash-meta = mihomo;
}).overrideAttrs (old: rec {
pname = "clash-nyanpasu";
version = "1.4.5";
src = fetchurl {
url = "https://github.com/keiko233/clash-nyanpasu/releases/download/v${version}/clash-nyanpasu_${version}_amd64.deb";
hash = "sha256-cxaq7Rndf0ytEaqc7CGQix5SOAdsTOoTj1Jlhjr5wEA=";
};
meta = old.meta // (with lib; {
homepage = "https://github.com/keiko233/clash-nyanpasu";
maintainers = with maintainers; [ Guanran928 ];
mainProgram = "clash-nyanpasu";
});
})

View File

@ -0,0 +1,19 @@
{ lib
, clash-verge
, fetchurl
}:
clash-verge.overrideAttrs (old: rec {
pname = "clash-verge-rev";
version = "1.5.4";
src = fetchurl {
url = "https://github.com/clash-verge-rev/clash-verge-rev/releases/download/v${version}/clash-verge_${version}_amd64.deb";
hash = "sha256-UJYLfefgUASBmh0gyNmjsWdAadluKhwaXZL1wlVlbjU=";
};
meta = old.meta // (with lib; {
homepage = "https://github.com/clash-verge-rev/clash-verge-rev";
maintainers = with maintainers; [ Guanran928 ];
});
})

View File

@ -42,13 +42,13 @@ stdenv.mkDerivation rec {
mkdir -p $out/bin
mv usr/* $out
rm $out/bin/{clash,clash-meta}
runHook postInstall
'';
postFixup = ''
ln -s ${lib.getExe clash-meta} $out/bin/clash-meta
rm -f $out/bin/clash
ln -sf ${lib.getExe clash-meta} $out/bin/${clash-meta.meta.mainProgram}
'';
meta = with lib; {

View File

@ -4640,8 +4640,6 @@ with pkgs;
clash-geoip = callPackage ../data/misc/clash-geoip { };
clash-verge = callPackage ../applications/networking/clash-verge { };
clevercsv = with python3Packages; toPythonApplication clevercsv;
clevis = callPackage ../tools/security/clevis {