-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpackage.nix
More file actions
54 lines (44 loc) · 1.31 KB
/
Copy pathpackage.nix
File metadata and controls
54 lines (44 loc) · 1.31 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
{
lib,
stdenv,
bun,
buildNpmPackage,
importNpmLock,
installShellFiles,
}:
buildNpmPackage {
pname = "seam";
version = (lib.importJSON ./package.json).version;
src = lib.cleanSource ./.;
npmDeps = importNpmLock { npmRoot = ./.; };
npmConfigHook = importNpmLock.npmConfigHook;
nativeBuildInputs = [
bun
installShellFiles
];
npmBuildScript = "build:standalone";
installPhase = ''
runHook preInstall
install -Dm755 seam -t $out/bin
runHook postInstall
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd seam \
--bash <($out/bin/seam completion --loader bash) \
--fish <($out/bin/seam completion --loader fish) \
--zsh <($out/bin/seam completion --loader zsh)
'';
# The executable is the Bun runtime with the JavaScript bundle appended, so
# rewriting the ELF loses the bundle: stripped it runs as plain Bun,
# patchelfed it segfaults.
dontStrip = true;
dontPatchELF = true;
meta = {
description = "Command-line interface (CLI) for interacting with the Seam API";
homepage = "https://github.com/seamapi/cli";
changelog = "https://github.com/seamapi/cli/releases";
license = lib.licenses.mit;
mainProgram = "seam";
platforms = bun.meta.platforms;
};
}