-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdevenv.nix
66 lines (62 loc) · 1.48 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
pkgs,
lib,
config,
inputs,
...
}: let
pkgu = import inputs.nixpkgs-unstable {system = pkgs.stdenv.system;};
in {
packages = with pkgu; [
natscli
nats-top
nats-server
gomarkdoc
];
pre-commit = {
hooks = {
check-merge-conflicts.enable = true;
check-added-large-files.enable = true;
editorconfig-checker.enable = true;
govet.enable = true;
gofmt.enable = true;
gen-doc-refs = {
enable = true;
entry = ''gen-doc-refs '';
};
};
};
enterTest = ''
go test ./... -race -coverprofile=coverage.out -covermode=atomic
'';
scripts = {
run-docs = {
exec = ''
mkdocs serve
'';
description = "Run the documentation server";
};
gen-doc-refs = {
exec = ''
CURRENT_DIR=$PWD
cd $CURRENT_DIR/vikunja && gomarkdoc --output ../docs/Vikunja.md
cd $CURRENT_DIR/utils && gomarkdoc --output ../docs/Utils.md
cd $CURRENT_DIR
'';
description = "Generate the documentation references";
};
};
# languages.go = {
# enable = true;
# package = pkgs.go;
# };
enterShell = ''
echo
echo 🦾 Useful project scripts:
echo 🦾
${pkgs.gnused}/bin/sed -e 's| |••|g' -e 's|=| |' <<EOF | ${pkgs.util-linuxMinimal}/bin/column -t | ${pkgs.gnused}/bin/sed -e 's|^|🦾 |' -e 's|••| |g'
${lib.generators.toKeyValue {} (lib.mapAttrs (_: value: value.description) config.scripts)}
EOF
echo
'';
}