-
Notifications
You must be signed in to change notification settings - Fork 102
Expand file tree
/
Copy pathpackage.nix
More file actions
68 lines (56 loc) · 1.76 KB
/
package.nix
File metadata and controls
68 lines (56 loc) · 1.76 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
{
lib,
stdenv,
fetchurl,
makeWrapper,
wrapBuddy,
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 = "jules";
inherit version;
src = fetchurl {
url = "https://storage.googleapis.com/jules-cli/v${version}/jules_external_v${version}_${platformSuffix}.tar.gz";
hash = hashes.${platform};
};
nativeBuildInputs = [ makeWrapper ] ++ lib.optionals stdenv.hostPlatform.isLinux [ wrapBuddy ];
# The tarball extracts to a directory with jules binary and licenses/ subdirectory
# Explicitly set sourceRoot to prevent Nix from picking licenses/ as the source
sourceRoot = ".";
installPhase = ''
runHook preInstall
install -Dm755 jules $out/bin/jules
runHook postInstall
'';
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
# Jules uses "version" subcommand, not --version flag
versionCheckProgramArg = [ "version" ];
passthru.category = "AI Coding Agents";
meta = with lib; {
description = "Jules, the asynchronous coding agent from Google, in the terminal";
homepage = "https://jules.google";
changelog = "https://jules.google/docs/changelog";
license = licenses.unfree;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
mainProgram = "jules";
platforms = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
};
}