-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
47 lines (43 loc) · 906 Bytes
/
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
{
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,
...
}: let
goEnv = mkGoEnv {pwd = ./.;};
pre-commit-check = pre-commit-hooks.lib.${pkgs.system}.run {
src = ./.;
hooks = {
golangci-lint.enable = true;
gotest.enable = true;
};
};
in
pkgs.mkShell {
inherit (pre-commit-check) shellHook;
hardeningDisable = ["all"];
packages = with pkgs; [
goEnv
gomod2nix
docker
golangci-lint
gotools
go-junit-report
gocover-cobertura
go-task
goreleaser
sqlc
vhs
];
}