nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildNpmPackage,
4 fetchFromGitHub,
5 esbuild,
6 buildGoModule,
7}:
8let
9 esbuild' = esbuild.override {
10 buildGoModule =
11 args:
12 buildGoModule (
13 args
14 // rec {
15 version = "0.24.0";
16 src = fetchFromGitHub {
17 owner = "evanw";
18 repo = "esbuild";
19 rev = "v${version}";
20 hash = "sha256-czQJqLz6rRgyh9usuhDTmgwMC6oL5UzpwNFQ3PKpKck=";
21 };
22 vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
23 }
24 );
25 };
26in
27
28buildNpmPackage (finalAttrs: {
29 pname = "fauna-shell";
30 version = "4.0.0";
31
32 src = fetchFromGitHub {
33 owner = "fauna";
34 repo = "fauna-shell";
35 tag = "v${finalAttrs.version}";
36 hash = "sha256-JbTS54e1pNxoqTAlEdOqKqkEyAzFJLI6he7/jivVPzI=";
37 };
38
39 patches = [
40 ./package-lock-fix.patch
41 ];
42
43 npmDepsHash = "sha256-RNgx3Oorc/+nHHZHdOmyA9Q3fCW7yaAzX0DqHbCMqt0=";
44
45 npmFlags = [ "--ignore-scripts" ];
46
47 env.ESBUILD_BINARY_PATH = lib.getExe esbuild';
48
49 # While this errors, it makes the build complete successfully. Therefore, ????
50 preBuild = ''
51 npm rebuild --verbose cpu-features
52 '';
53
54 npmBuildScript = "build:app";
55
56 passthru.updateScript = ./update.sh;
57
58 meta = {
59 description = "Interactive shell for FaunaDB";
60 homepage = "https://github.com/fauna/fauna-shell";
61 license = lib.licenses.mpl20;
62 maintainers = with lib.maintainers; [ pyrox0 ];
63 mainProgram = "fauna";
64 };
65})