-
Notifications
You must be signed in to change notification settings - Fork 28
/
flake.nix
75 lines (64 loc) · 2.52 KB
/
flake.nix
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
{
description = "Dev environment for LogPaste";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
# 1.21.1 release
go_dep.url = "github:NixOS/nixpkgs/78058d810644f5ed276804ce7ea9e82d92bee293";
# 3.44.2 release
sqlite_dep.url = "github:NixOS/nixpkgs/5ad9903c16126a7d949101687af0aa589b1d7d3d";
# 20.6.1 release
nodejs_dep.url = "github:NixOS/nixpkgs/78058d810644f5ed276804ce7ea9e82d92bee293";
# 0.9.0 release
shellcheck_dep.url = "github:NixOS/nixpkgs/8b5ab8341e33322e5b66fb46ce23d724050f6606";
# 1.2.1 release
sqlfluff_dep.url = "github:NixOS/nixpkgs/7cf5ccf1cdb2ba5f08f0ac29fc3d04b0b59a07e4";
# 0.1.147 release
flyctl_dep.url = "github:NixOS/nixpkgs/0a254180b4cad6be45aa46dce896bdb8db5d2930";
# 0.3.13 release
litestream_dep.url = "github:NixOS/nixpkgs/a343533bccc62400e8a9560423486a3b6c11a23b";
};
outputs = { self, flake-utils, go_dep, sqlite_dep, nodejs_dep, shellcheck_dep, sqlfluff_dep, flyctl_dep, litestream_dep }@inputs :
flake-utils.lib.eachDefaultSystem (system:
let
go_dep = inputs.go_dep.legacyPackages.${system};
sqlite_dep = inputs.sqlite_dep.legacyPackages.${system};
nodejs_dep = inputs.nodejs_dep.legacyPackages.${system};
shellcheck_dep = inputs.shellcheck_dep.legacyPackages.${system};
sqlfluff_dep = inputs.sqlfluff_dep.legacyPackages.${system};
flyctl_dep = inputs.flyctl_dep.legacyPackages.${system};
litestream_dep = inputs.litestream_dep.legacyPackages.${system};
in
{
devShells.default = go_dep.mkShell.override { stdenv = go_dep.pkgsStatic.stdenv; } {
packages = [
go_dep.gotools
go_dep.gopls
go_dep.go-outline
go_dep.gocode
go_dep.gopkgs
go_dep.gocode-gomod
go_dep.godef
go_dep.golint
go_dep.go_1_21
sqlite_dep.sqlite
nodejs_dep.nodejs_20
shellcheck_dep.shellcheck
sqlfluff_dep.sqlfluff
flyctl_dep.flyctl
litestream_dep.litestream
];
shellHook = ''
GOROOT="$(dirname $(dirname $(which go)))/share/go"
export GOROOT
echo "shellcheck" "$(shellcheck --version | grep '^version:')"
sqlfluff --version
echo "litestream" "$(litestream version)"
fly version | cut -d ' ' -f 1-3
echo "node" "$(node --version)"
echo "npm" "$(npm --version)"
echo "sqlite" "$(sqlite3 --version | cut -d ' ' -f 1-2)"
go version
'';
};
});
}