blob: a54bc0e3ca652509222ab4e118075369a706a835 (
about) (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
{
stdenvNoCC,
lib,
fetchurl,
curl,
common-updater-scripts,
writeShellApplication,
gnugrep,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "tideways-daemon";
version = "1.9.38";
src =
finalAttrs.passthru.sources.${stdenvNoCC.hostPlatform.system}
or (throw "Unsupported platform for tideways-cli: ${stdenvNoCC.hostPlatform.system}");
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp tideways-daemon $out/bin/tideways-daemon
chmod +x $out/bin/tideways-daemon
runHook postInstall
'';
passthru = {
sources = {
"x86_64-linux" = fetchurl {
url = "https://tideways.s3.amazonaws.com/daemon/${finalAttrs.version}/tideways-daemon_linux_amd64-${finalAttrs.version}.tar.gz";
hash = "sha256-zQ8K0oHTZfQCEYAsnKsdgGaDTlRwEfCiJpd4lxy4Q5M=";
};
"aarch64-linux" = fetchurl {
url = "https://tideways.s3.amazonaws.com/daemon/${finalAttrs.version}/tideways-daemon_linux_aarch64-${finalAttrs.version}.tar.gz";
hash = "sha256-atRvSpc56z5Vxo5/YGz9QzCPEP79qjl2GN0vR3nkBAE=";
};
"aarch64-darwin" = fetchurl {
url = "https://tideways.s3.amazonaws.com/daemon/${finalAttrs.version}/tideways-daemon_macos_arm64-${finalAttrs.version}.tar.gz";
hash = "sha256-+X+WbHtOFW4YGyRmj388bBH0jHezWnPfTBiiOw3LFFY=";
};
};
updateScript = "${
writeShellApplication {
name = "update-tideways-daemon";
runtimeInputs = [
curl
gnugrep
common-updater-scripts
];
text = ''
NEW_VERSION=$(curl --fail -L -s https://tideways.com/profiler/downloads | grep -E 'https://tideways.s3.amazonaws.com/daemon/([0-9]+\.[0-9]+\.[0-9]+)/tideways-daemon_linux_amd64-\1.tar.gz' | grep -oP 'daemon/\K[0-9]+\.[0-9]+\.[0-9]+')
if [[ "${finalAttrs.version}" = "$NEW_VERSION" ]]; then
echo "The new version same as the old version."
exit 0
fi
for platform in ${lib.escapeShellArgs finalAttrs.meta.platforms}; do
update-source-version "tideways-daemon" "$NEW_VERSION" --ignore-same-version --source-key="sources.$platform"
done
'';
}
}/bin/update-tideways-daemon";
};
meta = with lib; {
description = "Tideways Daemon";
homepage = "https://tideways.com/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
mainProgram = "tideways-daemon";
license = licenses.unfree;
maintainers = with maintainers; [ shyim ];
platforms = lib.attrNames finalAttrs.passthru.sources;
};
})
|