Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.3 KiB
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
lib,
stdenv,
fetchFromGitHub,
fetchYarnDeps,
yarnConfigHook,
yarnInstallHook,
nodejs,
makeBinaryWrapper,
nix-update-script,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cloudflare-cli";
version = "5.1.0";
src = fetchFromGitHub {
owner = "danielpigott";
repo = "cloudflare-cli";
tag = "v${finalAttrs.version}";
hash = "sha256-FE6LvzGd3Pl31vocXSZ6VY6P3iuVPxQR1eJwUSkXf70=";
};
yarnOfflineCache = fetchYarnDeps {
yarnLock = finalAttrs.src + "/yarn.lock";
hash = "sha256-dH0eW2IIxgqLiJHAmDKbeA0xz2EMWrZrKIf3P2mBDKU=";
};
nativeBuildInputs = [
yarnConfigHook
yarnInstallHook
nodejs
makeBinaryWrapper
];
postInstall = ''
wrapProgram $out/bin/cfcli \
--chdir $out/lib/node_modules/cloudflare-cli
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/cfcli --help >/dev/null
runHook postInstallCheck
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "CLI for interacting with Cloudflare";
homepage = "https://github.com/danielpigott/cloudflare-cli";
changelog = "https://github.com/danielpigott/cloudflare-cli/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ defelo ];
mainProgram = "cfcli";
};
})