-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
79 lines (65 loc) · 2.02 KB
/
flake.nix
File metadata and controls
79 lines (65 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{
description = "b24-cli — manage Bitrix24 from terminal";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = nixpkgs.legacyPackages.${system};
b24-cli = pkgs.buildNpmPackage rec {
pname = "b24-cli";
version = "1.0.0";
src = ./.;
npmDepsHash = "sha256-hlVP+rmWQ+EH65pJpoIDP5hOXisbY+QexXL+C0LPbl0=";
nodejs = pkgs.nodejs_22;
buildPhase = ''
npm run build
'';
installPhase = ''
mkdir -p $out/lib/node_modules/b24-cli
cp -r dist package.json node_modules $out/lib/node_modules/b24-cli/
mkdir -p $out/bin
ln -s $out/lib/node_modules/b24-cli/dist/cli.js $out/bin/b24-cli
ln -s $out/lib/node_modules/b24-cli/dist/cli.js $out/bin/b24
chmod +x $out/bin/b24-cli
chmod +x $out/bin/b24
'';
meta = with pkgs.lib; {
description = "CLI tool to manage Bitrix24 tasks, comments, time tracking from terminal";
homepage = "https://github.com/nnolan-oss/b24-cli";
license = licenses.mit;
platforms = platforms.all;
mainProgram = "b24";
};
};
in {
packages = {
default = b24-cli;
b24-cli = b24-cli;
};
apps.default = {
type = "app";
program = "${b24-cli}/bin/b24";
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
nodejs_22
nodePackages.npm
nodePackages.typescript
];
shellHook = ''
echo "b24-cli dev shell"
echo " npm install — install deps"
echo " npm run build — build project"
echo " npm link — link globally"
'';
};
}
);
}