forked from inngest/inngest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
120 lines (104 loc) · 3.58 KB
/
flake.nix
File metadata and controls
120 lines (104 loc) · 3.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
{
description = "Inngest Dev Server";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=master";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
corepack = pkgs.stdenv.mkDerivation {
name = "corepack";
buildInputs = [ pkgs.nodejs_22 ];
phases = [ "installPhase" ];
installPhase = ''
mkdir -p $out/bin
corepack enable --install-directory=$out/bin
'';
};
# install grpc gateway binaries
grpc-gateway = pkgs.stdenv.mkDerivation rec {
pname = "grpc-gateway";
version = "2.27.1";
arch = if pkgs.stdenv.isAarch64 then "arm64" else "x86_64";
os = if pkgs.stdenv.isDarwin then "darwin" else "linux";
protoc-gen-grpc-gateway = pkgs.fetchurl {
url =
"https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v${version}/protoc-gen-grpc-gateway-v${version}-${os}-${arch}";
sha256 = {
"darwin-x86_64" =
"0z53qg60mwax8kvrjcs5bngf46ksh86zdwib0pq0dbqz32n04n54";
"darwin-arm64" =
"0g6rnkl4sy5wd8iyxvli892y3d3228bsiia223p3md9nplsj1fba";
"linux-x86_64" =
"0jb6d53irbzkcmii0xaykc9m528zjja0inzl97g49mcp21qzidvl";
"linux-arm64" =
"1nmwjv8ymqm51q5sfkisx9vhkla5s03w14g69h33g6118rcq6zl3";
}."${os}-${arch}";
};
protoc-gen-openapiv2 = pkgs.fetchurl {
url =
"https://github.com/grpc-ecosystem/grpc-gateway/releases/download/v${version}/protoc-gen-openapiv2-v${version}-${os}-${arch}";
sha256 = {
"darwin-x86_64" =
"19msmjgwcpzk6ji2b1dycgkxahmcm89ws7l52ssw80akzqqnn3ga";
"darwin-arm64" =
"13zi36ghlhv6cdcx9xza6iy2sp8mcz8axg8r4jy3n6626fwf4wrv";
"linux-x86_64" =
"09r3dscpxnj487iinqjxy5psyh14vz7gclj4xl4w21hm1wzcaqyi";
"linux-arm64" =
"1162m9s7899ia2g3pmynb2403pdszpn91b6dasagzm4pl4gdn41m";
}."${os}-${arch}";
};
dontUnpack = true;
installPhase = ''
mkdir -p $out/bin
install -m755 ${protoc-gen-grpc-gateway} $out/bin/protoc-gen-grpc-gateway
install -m755 ${protoc-gen-openapiv2} $out/bin/protoc-gen-openapiv2
'';
};
in {
devShells.default = pkgs.mkShell {
packages = [ corepack grpc-gateway ];
nativeBuildInputs = with pkgs; [
# Go
go
golangci-lint
gotests
gomodifytags
gore
gotools
goreleaser
delve
# Lua
lua
# Node
typescript
nodejs_22
# LSPs
gopls
nodePackages.typescript-language-server
nodePackages.vscode-json-languageserver
nodePackages.yaml-language-server
lua-language-server
# Tools
sqlite-interactive
sqlc
buf
protobuf
protoc-gen-go
protoc-gen-go-grpc
protoc-gen-connect-go
swagger-codegen3
];
shellHook = ''
export GOBIN=$PWD/bin
export PATH="$PATH:$GOBIN:$HOME/go/bin"
'';
};
});
}