add clash-updater

This commit is contained in:
guochao 2022-07-15 12:59:49 +08:00
parent 137633587b
commit 1d8fbd2cdd
2 changed files with 24 additions and 1 deletions

View File

@ -49,6 +49,20 @@ stdenv.mkDerivation {
fi fi
''; '';
makeUpdater = { subscription, name }: stdenv.mkDerivation {
name = "clash-updater-${name}";
src = ./updater.sh;
dontConfigure = true;
dontBuild = true;
dontPatchELF = true;
dontUnpack = true;
installPhase = ''
makeWrapper $src $out/bin/clash-updater-${name} --set SUBSCRIPTION_URL "${subscription}"
'';
};
meta = { meta = {
description = "close-sourced pre-built Clash binary with TUN support and more"; description = "close-sourced pre-built Clash binary with TUN support and more";
homepage = "https://github.com/Dreamacro/clash/releases/premium"; homepage = "https://github.com/Dreamacro/clash/releases/premium";
@ -59,4 +73,5 @@ stdenv.mkDerivation {
"aarch64-linux" "aarch64-linux"
]; ];
}; };
} }

View File

@ -0,0 +1,8 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
env
sleep 10000