blob: 12e60866c8dd7157c0779b6c2f9f703ca2c9d78f (
plain)
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
|
{
bash,
fetchPnpmDeps,
nodejs_22,
pnpm_11,
pnpmConfigHook,
stdenv,
src,
}:
let
pnpm = pnpm_11;
in
stdenv.mkDerivation (finalAttrs: {
pname = "cgithub";
version = "1.0.0";
inherit src;
nativeBuildInputs = [
nodejs_22
pnpmConfigHook
pnpm
];
pnpmDeps = fetchPnpmDeps {
inherit (finalAttrs) pname version src;
inherit pnpm;
fetcherVersion = 4;
hash = "sha256-XxkTo+JeFyPEVgIJYm4/VaIAijaj4Sc0EzCCjZsu62Q=";
};
buildPhase = ''
node scripts/build.ts
'';
installPhase = ''
mkdir -p "$out/bin"
cp -a . "$out/"
cat > "$out/bin/cgithub-server" <<EOF
#!${bash}/bin/bash
exec ${nodejs_22}/bin/node "$out/src/index.ts" "\$@"
EOF
chmod +x "$out/bin/cgithub-server"
'';
})
|