-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy pathpackage.nix
More file actions
83 lines (69 loc) · 2.01 KB
/
package.nix
File metadata and controls
83 lines (69 loc) · 2.01 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
80
81
82
83
{
lib,
stdenv,
fetchurl,
wrapBuddy,
gcc-unwrapped,
versionCheckHook,
}:
let
versionData = builtins.fromJSON (builtins.readFile ./hashes.json);
inherit (versionData) version hashes;
platformMap = {
x86_64-linux = "linux_amd64";
aarch64-linux = "linux_arm64";
x86_64-darwin = "darwin_amd64";
aarch64-darwin = "darwin_arm64";
};
platform = stdenv.hostPlatform.system;
platformSuffix = platformMap.${platform} or (throw "Unsupported system: ${platform}");
in
stdenv.mkDerivation {
pname = "catnip";
inherit version;
src = fetchurl {
url = "https://github.com/wandb/catnip/releases/download/v${version}/catnip_${version}_${platformSuffix}.tar.gz";
hash = hashes.${platform};
};
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ wrapBuddy ];
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
gcc-unwrapped.lib
];
sourceRoot = ".";
installPhase = ''
runHook preInstall
${
if stdenv.hostPlatform.isDarwin then
''
mkdir -p $out/Applications
cp -r Catnip.app $out/Applications/
mkdir -p $out/bin
ln -s $out/Applications/Catnip.app/Contents/MacOS/catnip $out/bin/catnip
''
else
''
install -Dm755 catnip $out/bin/catnip
''
}
runHook postInstall
'';
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
passthru.category = "Claude Code Ecosystem";
meta = with lib; {
description = "Developer environment that's like catnip for agentic programming";
homepage = "https://github.com/wandb/catnip";
changelog = "https://github.com/wandb/catnip/releases/tag/v${version}";
downloadPage = "https://github.com/wandb/catnip/releases";
license = licenses.asl20;
maintainers = with maintainers; [ ];
platforms = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
mainProgram = "catnip";
};
}