-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevenv.nix
49 lines (41 loc) · 819 Bytes
/
devenv.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
{
lib,
pkgs,
...
}:
{
cachix.enable = false;
packages = with pkgs; [
# Formatting
gofumpt
goimports-reviser
golines
# LSP
delve # debugger
gopls
# Tools
go-tools
gotestsum
gotools
gotestdox
];
languages.go.enable = true;
# Required for Delve debugger
# https://github.com/go-delve/delve/issues/3085
languages.go.enableHardeningWorkaround = true;
# Aliases
scripts = {
# run tests in the current directory (all from root)
tt.exec = ''
gotestsum --format testname "$@"
'';
# run tests in the current directory (as readable documentation)
td.exec = ''
gotestdox ./... "$@"
'';
# watch go files and test on changes
tw.exec = ''
gotestsum --format testname --watch-chdir --watch
'';
};
}