Merge pull request #281360 from Guanran928/clash
clash-{nyanpasu,verge-rev}: init
This commit is contained in:
commit
ad272aadc4
6 changed files with 54 additions and 7 deletions
|
@ -7427,6 +7427,12 @@
|
||||||
githubId = 21156405;
|
githubId = 21156405;
|
||||||
name = "GuangTao Zhang";
|
name = "GuangTao Zhang";
|
||||||
};
|
};
|
||||||
|
Guanran928 = {
|
||||||
|
email = "guanran928@outlook.com";
|
||||||
|
github = "Guanran928";
|
||||||
|
githubId = 68757440;
|
||||||
|
name = "Guanran928";
|
||||||
|
};
|
||||||
guekka = {
|
guekka = {
|
||||||
github = "Guekka";
|
github = "Guekka";
|
||||||
githubId = 39066502;
|
githubId = 39066502;
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
{
|
{
|
||||||
options.programs.clash-verge = {
|
options.programs.clash-verge = {
|
||||||
enable = lib.mkEnableOption (lib.mdDoc "Clash Verge");
|
enable = lib.mkEnableOption (lib.mdDoc "Clash Verge");
|
||||||
|
package = lib.mkPackageOption pkgs "clash-verge" {};
|
||||||
autoStart = lib.mkEnableOption (lib.mdDoc "Clash Verge auto launch");
|
autoStart = lib.mkEnableOption (lib.mdDoc "Clash Verge auto launch");
|
||||||
tunMode = lib.mkEnableOption (lib.mdDoc "Clash Verge TUN mode");
|
tunMode = lib.mkEnableOption (lib.mdDoc "Clash Verge TUN mode");
|
||||||
};
|
};
|
||||||
|
@ -14,10 +15,10 @@
|
||||||
lib.mkIf cfg.enable {
|
lib.mkIf cfg.enable {
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.clash-verge
|
cfg.package
|
||||||
(lib.mkIf cfg.autoStart (pkgs.makeAutostartItem {
|
(lib.mkIf cfg.autoStart (pkgs.makeAutostartItem {
|
||||||
name = "clash-verge";
|
name = "clash-verge";
|
||||||
package = pkgs.clash-verge;
|
package = cfg.package;
|
||||||
}))
|
}))
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -25,7 +26,7 @@
|
||||||
owner = "root";
|
owner = "root";
|
||||||
group = "root";
|
group = "root";
|
||||||
capabilities = "cap_net_bind_service,cap_net_admin=+ep";
|
capabilities = "cap_net_bind_service,cap_net_admin=+ep";
|
||||||
source = "${lib.getExe pkgs.clash-verge}";
|
source = "${lib.getExe cfg.package}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
23
pkgs/by-name/cl/clash-nyanpasu/package.nix
Normal file
23
pkgs/by-name/cl/clash-nyanpasu/package.nix
Normal 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";
|
||||||
|
});
|
||||||
|
})
|
19
pkgs/by-name/cl/clash-verge-rev/package.nix
Normal file
19
pkgs/by-name/cl/clash-verge-rev/package.nix
Normal 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 ];
|
||||||
|
});
|
||||||
|
})
|
|
@ -42,13 +42,13 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
mv usr/* $out
|
mv usr/* $out
|
||||||
rm $out/bin/{clash,clash-meta}
|
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = ''
|
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; {
|
meta = with lib; {
|
|
@ -4640,8 +4640,6 @@ with pkgs;
|
||||||
|
|
||||||
clash-geoip = callPackage ../data/misc/clash-geoip { };
|
clash-geoip = callPackage ../data/misc/clash-geoip { };
|
||||||
|
|
||||||
clash-verge = callPackage ../applications/networking/clash-verge { };
|
|
||||||
|
|
||||||
clevercsv = with python3Packages; toPythonApplication clevercsv;
|
clevercsv = with python3Packages; toPythonApplication clevercsv;
|
||||||
|
|
||||||
clevis = callPackage ../tools/security/clevis {
|
clevis = callPackage ../tools/security/clevis {
|
||||||
|
|
Loading…
Reference in a new issue