Skip to content

Commit 57d927a

Browse files
curranosauruslf-
authored andcommitted
chalk: init at 1.29.4
1 parent 397fe89 commit 57d927a

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

pkgs/by-name/ch/chalk/package.nix

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
lib,
3+
stdenv,
4+
fetchurl,
5+
}:
6+
let
7+
# This derivation is adapted from the
8+
# install script that Chalk recommends: https://api.chalk.ai/install.sh
9+
chalkVersion = "1.29.4";
10+
chalkPathPiecesByNixSystem = {
11+
"aarch64-darwin" = "Darwin/aarch64";
12+
"x86_64-darwin" = "Darwin/x86_64";
13+
"aarch64-linux" = "Linux/aarch64";
14+
"x86_64-linux" = "Linux/x86_64";
15+
};
16+
chalkHashByNixSystem = {
17+
"aarch64-darwin" = "sha256-zHPfyeHdHfbxrUhjLJHbLkeuu7WwK4jtYX7bk5wimX0=";
18+
"x86_64-darwin" = "sha256-D6lBrnBlD+OU5kQv6b6BzK+u7vB91rTtYpz8iBUeWdA=";
19+
"aarch64-linux" = "sha256-XHaCLxVJbXjPILczDGWLFqP0q/nBO5O2A9lghkvM474=";
20+
"x86_64-linux" = "sha256-hlNljLJm+m7l+Djni+ATKyWKSGKSDP0YN3CuJ4fXmWg=";
21+
};
22+
chalkHash = chalkHashByNixSystem."${stdenv.system}";
23+
chalkPathPieces = chalkPathPiecesByNixSystem."${stdenv.system}";
24+
chalkUrl = "https://api.chalk.ai/v1/install/${chalkPathPieces}/v${chalkVersion}";
25+
in
26+
stdenv.mkDerivation {
27+
pname = "chalk";
28+
version = chalkVersion;
29+
src = fetchurl {
30+
url = chalkUrl;
31+
hash = chalkHash;
32+
};
33+
dontUnpack = true;
34+
35+
installPhase = ''
36+
runHook preInstall
37+
install -Dm 555 $src $out/bin/chalk
38+
runHook postInstall
39+
'';
40+
41+
meta = {
42+
description = "CLI tool for interacting with the Chalk platform";
43+
homepage = "https://docs.chalk.ai/cli";
44+
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
45+
license = lib.licenses.unfree;
46+
maintainers = with lib.maintainers; [ curran ];
47+
mainProgram = "chalk";
48+
platforms = [
49+
"x86_64-linux"
50+
"x86_64-darwin"
51+
"aarch64-linux"
52+
"aarch64-darwin"
53+
];
54+
};
55+
}

0 commit comments

Comments
 (0)