Skip to content

Instantly share code, notes, and snippets.

@NickLarsenNZ
Created July 25, 2024 20:38
Show Gist options
  • Save NickLarsenNZ/e35943aada6d38ac6a2bf16f7d08561d to your computer and use it in GitHub Desktop.
Save NickLarsenNZ/e35943aada6d38ac6a2bf16f7d08561d to your computer and use it in GitHub Desktop.
Replicated CLI for Nix
{ stdenv
, lib
, fetchurl
, installShellFiles
}:
stdenv.mkDerivation rec {
pname = "replicated";
version = "0.78.0";
src = fetchurl {
url = "https://github.com/replicatedhq/replicated/releases/download/v${version}/replicated_${version}_linux_amd64.tar.gz";
hash = "sha256-Si5cbAkVMMt11Ipn61eQXR9ZQIUFDtY7O87FaCriBIM=";
};
nativeBuildInputs = [
installShellFiles
];
sourceRoot = ".";
installPhase = ''
runHook preInstall
install -m755 -D replicated $out/bin/replicated
installShellCompletion --cmd replicated \
--bash <($out/bin/replicated completion bash) \
--fish <($out/bin/replicated completion fish) \
--zsh <($out/bin/replicated completion zsh)
runHook postInstall
'';
meta = with lib; {
homepage = "https://replicated.com";
description = "Replicated CLI";
platforms = platforms.linux;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment