-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.nix
More file actions
80 lines (74 loc) · 1.37 KB
/
Copy pathdefault.nix
File metadata and controls
80 lines (74 loc) · 1.37 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
{
lib,
buildNpmPackage,
typescript,
bun,
tmux,
guile,
python3,
nix,
bash,
R,
mitscheme,
jscpd,
importNpmLock,
}:
buildNpmPackage (finalAttrs: {
pname = "opencode-tmux-repl";
version = (lib.importJSON ./package.json).version;
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions [
./src
./test
./eslint.config.js
./knip.json
./.madgerc
./package.json
./package-lock.json
./tsconfig.json
];
};
npmDeps = importNpmLock {
npmRoot = finalAttrs.src;
};
npmConfigHook = importNpmLock.npmConfigHook;
nativeBuildInputs = [
typescript
bun
tmux
guile
(python3.withPackages (ps: [ ps.ipython ]))
nix
bash
R
mitscheme
jscpd
];
buildPhase = ''
runHook preBuild
tsc -p tsconfig.json
runHook postBuild
'';
doCheck = true;
checkPhase = ''
runHook preCheck
export PATH="$PWD/node_modules/.bin:$PATH"
bun test
eslint src/ test/
knip
jscpd src/ test/ --threshold 1
madge --circular --extensions ts src/index.ts
runHook postCheck
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r src package.json package-lock.json tsconfig.json $out/
runHook postInstall
'';
meta = {
description = "Shared tmux REPL tools for OpenCode";
license = lib.licenses.mit;
};
})