chronoctl.nix (1200B) - Raw
1 { 2 stdenv, 3 fetchurl, 4 }: 5 6 let 7 version = "0.71.0"; 8 sources = { 9 x86_64-linux = { 10 url = "https://storage.googleapis.com/chronosphere-release/${version}/chronoctl-linux-amd64"; 11 # nix store prefetch-file --hash-type sha256 https://storage.googleapis.com/chronosphere-release/0.71.0/chronoctl-linux-amd64 12 hash = "sha256-SE7wuSRh3lwx7IBzqMsV3hy4DeHLfbs60uHhhIsLZMs="; 13 }; 14 15 aarch64-linux = { 16 url = "https://storage.googleapis.com/chronosphere-release/${version}/chronoctl-linux-arm64"; 17 # Replace with the real hash (SRI). For a quick prefetch: 18 # nix store prefetch-file --hash-type sha256 https://storage.googleapis.com/chronosphere-release/0.71.0/chronoctl-linux-arm64 19 hash = "sha256-iM9fLvpRdpvnxN+Rto1zh5BhwwEkLSuhPzODYd2TtJo="; 20 }; 21 }; 22 23 srcInfo = 24 sources.${stdenv.hostPlatform.system} 25 or (throw "chronoctl: unsupported system ${stdenv.hostPlatform.system}"); 26 in 27 28 stdenv.mkDerivation { 29 pname = "chronoctl"; 30 inherit version; 31 32 src = fetchurl { 33 inherit (srcInfo) url hash; 34 }; 35 36 dontUnpack = true; 37 38 installPhase = '' 39 runHook preInstall 40 install -Dm755 "$src" "$out/bin/chronoctl" 41 runHook postInstall 42 ''; 43 }