initial commit
This commit is contained in:
commit
137633587b
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
result
|
1
default.nix
Normal file
1
default.nix
Normal file
@ -0,0 +1 @@
|
||||
import ./pkgs/top-level/all-packages.nix
|
62
pkgs/network/proxy/clash-premium/default.nix
Normal file
62
pkgs/network/proxy/clash-premium/default.nix
Normal file
@ -0,0 +1,62 @@
|
||||
{ pkgs, stdenv, fetchurl, version, ... }: with pkgs;
|
||||
|
||||
let
|
||||
systemTriple = {
|
||||
"x86_64-darwin" = {
|
||||
system = "darwin-amd64";
|
||||
sha256 = "ccdb2760be48c2f51106fcc16c995cbd7d1a64cd5f742f44c9cba8ddc9bcba9c";
|
||||
};
|
||||
"aarch64-darwin" = {
|
||||
system = "darwin-arm64";
|
||||
sha256 = "9c3dbbb237e45c23f166911ad728d7b88e513ffdb9ac7ba8c7c77b41591945a6";
|
||||
};
|
||||
"x86_64-linux" = {
|
||||
system = "linux-amd64";
|
||||
sha256 = "26618ff738a8bb3490148d64be933e7a399089b28ff1434f0d78663640425a2f";
|
||||
};
|
||||
"aarch64-linux" = {
|
||||
system = "linux-armv7";
|
||||
sha256 = "f6086b37866b4ea2b9e4204d171d18fdcd44c7d81d2c1a0b22a305f369d204a3";
|
||||
};
|
||||
};
|
||||
currentTriple = systemTriple."${stdenv.targetPlatform.system}";
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
name = "clash-premium";
|
||||
src = fetchurl {
|
||||
url = "https://github.com/Dreamacro/clash/releases/download/premium/clash-${currentTriple.system}-${version}.gz";
|
||||
sha256 = currentTriple.sha256;
|
||||
};
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
dontPatchELF = true;
|
||||
doInstallCheck = true;
|
||||
|
||||
unpackPhase = ''
|
||||
FILENAME=$(${coreutils}/bin/basename $src)
|
||||
${coreutils}/bin/cp $src clash.gz
|
||||
${gzip}/bin/gzip -k -d clash.gz
|
||||
'';
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
${coreutils}/bin/mkdir -p $out/bin
|
||||
${coreutils}/bin/install -m 0755 clash $out/bin/clash
|
||||
|
||||
if [ "${system}" == "linux" ]; then
|
||||
patchelf \
|
||||
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
||||
$out/bin/clash
|
||||
fi
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "close-sourced pre-built Clash binary with TUN support and more";
|
||||
homepage = "https://github.com/Dreamacro/clash/releases/premium";
|
||||
platforms = [
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
];
|
||||
};
|
||||
}
|
5
pkgs/top-level/all-packages.nix
Normal file
5
pkgs/top-level/all-packages.nix
Normal file
@ -0,0 +1,5 @@
|
||||
with import <nixpkgs> {};
|
||||
with pkgs;
|
||||
{
|
||||
clash-premium = callPackage ../network/proxy/clash-premium { version = "2022.07.07"; };
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user