nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildNpmPackage,
4 fetchFromGitHub,
5 udev,
6 nix-update-script,
7}:
8
9buildNpmPackage (finalAttrs: {
10 pname = "particle-cli";
11 version = "3.45.0";
12
13 src = fetchFromGitHub {
14 owner = "particle-iot";
15 repo = "particle-cli";
16 tag = "v${finalAttrs.version}";
17 hash = "sha256-Hq2flUBStEouVEhYI25fNFK9ohvHfk792vlPa7b3DRA=";
18 };
19
20 npmDepsHash = "sha256-rHT8ZLBe3uO1NxrbVBdrh0fn9gvBVq4XE8Gfhcshq/E=";
21
22 buildInputs = [
23 udev
24 ];
25
26 dontNpmBuild = true;
27 dontNpmPrune = true;
28
29 postInstall = ''
30 install -D -t $out/etc/udev/rules.d \
31 $out/lib/node_modules/particle-cli/assets/50-particle.rules
32 '';
33
34 passthru.updateScript = nix-update-script { };
35
36 meta = {
37 description = "Command Line Interface for Particle Cloud and devices";
38 homepage = "https://github.com/particle-iot/particle-cli";
39 maintainers = with lib.maintainers; [ jess ];
40 mainProgram = "particle";
41 license = lib.licenses.asl20;
42 };
43})