nixpkgs/pkgs/by-name/ba/balena-cli/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

78 lines
1.9 KiB
Nix

{
lib,
stdenv,
buildNpmPackage,
fetchFromGitHub,
testers,
balena-cli,
node-gyp,
python3,
udev,
cctools,
apple-sdk_12,
darwinMinVersionHook,
}:
buildNpmPackage rec {
pname = "balena-cli";
version = "19.0.13";
src = fetchFromGitHub {
owner = "balena-io";
repo = "balena-cli";
rev = "v${version}";
hash = "sha256-2U+P3LsxaRpktNbDn8iNhHQVjokiWZADYVDpJsDosZU=";
};
npmDepsHash = "sha256-CA6qs9Gk19dEK2yCFMVVKmJSoZVLdpnf4V6P5fv2Bcc=";
postPatch = ''
ln -s npm-shrinkwrap.json package-lock.json
'';
makeCacheWritable = true;
nativeBuildInputs =
[
node-gyp
python3
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
cctools
];
buildInputs =
lib.optionals stdenv.hostPlatform.isLinux [
udev
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_12
];
passthru.tests.version = testers.testVersion {
package = balena-cli;
command = ''
# Override default cache directory so Balena CLI's unavoidable update check does not fail due to write permissions
BALENARC_DATA_DIRECTORY=./ balena --version
'';
inherit version;
};
meta = with lib; {
description = "Command line interface for balenaCloud or openBalena";
longDescription = ''
The balena CLI is a Command Line Interface for balenaCloud or openBalena. It is a software
tool available for Windows, macOS and Linux, used through a command prompt / terminal window.
It can be used interactively or invoked in scripts. The balena CLI builds on the balena API
and the balena SDK, and can also be directly imported in Node.js applications.
'';
homepage = "https://github.com/balena-io/balena-cli";
changelog = "https://github.com/balena-io/balena-cli/blob/v${version}/CHANGELOG.md";
license = licenses.asl20;
maintainers = [
maintainers.kalebpace
maintainers.doronbehar
];
mainProgram = "balena";
};
}