-
Notifications
You must be signed in to change notification settings - Fork 102
Expand file tree
/
Copy pathpackage.nix
More file actions
74 lines (58 loc) · 1.58 KB
/
package.nix
File metadata and controls
74 lines (58 loc) · 1.58 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
{
lib,
buildNpmPackage,
fetchFromGitHub,
bun,
versionCheckHook,
versionCheckHomeHook,
}:
let
versionData = builtins.fromJSON (builtins.readFile ./hashes.json);
inherit (versionData) version hash npmDepsHash;
in
buildNpmPackage {
pname = "cc-sdd";
inherit version npmDepsHash;
src = fetchFromGitHub {
owner = "gotalab";
repo = "cc-sdd";
rev = "v${version}";
inherit hash;
};
sourceRoot = "source/tools/cc-sdd";
# Build with tsc
buildPhase = ''
runHook preBuild
npm run build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/lib/cc-sdd
cp -r dist $out/lib/cc-sdd/
cp -r templates $out/lib/cc-sdd/
cp package.json $out/lib/cc-sdd/
chmod +x $out/lib/cc-sdd/dist/cli.js
substituteInPlace $out/lib/cc-sdd/dist/cli.js \
--replace-fail "#!/usr/bin/env node" "#!${bun}/bin/bun"
ln -s $out/lib/cc-sdd/dist/cli.js $out/bin/cc-sdd
runHook postInstall
'';
dontNpmBuild = false;
doInstallCheck = true;
nativeInstallCheckInputs = [
versionCheckHook
versionCheckHomeHook
];
passthru.category = "Workflow & Project Management";
meta = with lib; {
description = "Spec-driven development framework for AI coding agents";
homepage = "https://github.com/gotalab/cc-sdd";
changelog = "https://github.com/gotalab/cc-sdd/releases/tag/v${version}";
license = licenses.mit;
sourceProvenance = with lib.sourceTypes; [ fromSource ];
maintainers = with maintainers; [ ryoppippi ];
mainProgram = "cc-sdd";
platforms = platforms.all;
};
}