-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
60 lines (59 loc) · 1.95 KB
/
shell.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
{
pkgs ? (let
inherit (builtins) fetchTree fromJSON readFile;
inherit ((fromJSON (readFile ./flake.lock)).nodes) nixpkgs gomod2nix;
in
import (fetchTree nixpkgs.locked) {
overlays = [(import "${fetchTree gomod2nix.locked}/overlay.nix")];
}),
mkGoEnv ? pkgs.mkGoEnv,
gomod2nix ? pkgs.gomod2nix,
pre-commit-hooks,
devShellPackages,
...
}: let
goEnv = mkGoEnv {pwd = ./.;};
pre-commit-check = pre-commit-hooks.lib.${pkgs.system}.run {
src = ./.;
hooks = {
golangci-lint.enable = true;
gotest.enable = true;
golines = {
enable = true;
settings = {flags = "-m 120";};
};
generate = {
enable = true;
name = "Generate code such as tailwindcss, templ components and sqlc";
entry = "task generate";
pass_filenames = false;
};
};
};
in
pkgs.mkShell {
hardeningDisable = ["all"];
shellHook = ''
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
export PLAYWRIGHT_BROWSERS_PATH="${pkgs.playwright-driver.browsers}"
export PLAYWRIGHT_NODEJS_PATH="${pkgs.nodejs}/bin/node"
export PLAYWRIGHT_DRIVER_PATH="${pkgs.playwright-driver}"
export GOOSE_MIGRATION_DIR="./db/migrations"
export TEMPL_EXPERIMENT=rawgo
export BANTERBUS_LOG_LEVEL=debug
export BANTERBUS_DB_HOST=localhost
export BANTERBUS_DB_USERNAME=postgres
export BANTERBUS_DB_PASSWORD=postgres
export BANTERBUS_DB_NAME=postgres
export BANTERBUS_REDIS_ADDRESS="localhost:6379"
export BANTERBUS_PLAYWRIGHT_HEADLESS=false
export BANTERBUS_ENVIRONMENT=local
export BANTERBUS_AUTO_RECONNECT=true
export BANTERBUS_JWKS_URL=http://localhost:9090/default/jwks
export CGO_ENABLED=0
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
${pre-commit-check.shellHook}
'';
buildInputs = pre-commit-check.enabledPackages;
packages = devShellPackages ++ [goEnv gomod2nix pkgs.gitlab-ci-local];
}