-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevenv.nix
72 lines (70 loc) · 1.9 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
67
68
69
70
71
72
{
lib,
pkgs,
config,
...
}:
{
env.GREET = "homelab-ops";
env.KUBECONFIG = "./kubernetes/kubeconfig";
env.TALOSCONFIG = "./kubernetes/talos/clusterconfig/talosconfig";
env.MINIJINJA_CONFIG_FILE = ".minijinja.toml";
# replace pre-commit and various linters
git-hooks = {
# exclude = "_assets\/.*";
hooks = {
actionlint = {
enable = true;
files = "github\/workflows\/.*\.(yml|yaml)$";
};
prettier = {
enable = true;
settings = {
tab-width = 2;
trailing-comma = "es5";
use-tabs = false;
};
};
yamllint = {
enable = true;
settings.configuration = ''
---
extends: default
rules:
truthy:
allowed-values: ["true", "false", "on"]
comments:
min-spaces-from-content: 1
line-length: disable
braces:
min-spaces-inside: 0
max-spaces-inside: 1
brackets:
min-spaces-inside: 0
max-spaces-inside: 0
indentation: enable
'';
};
# disable this check when using ci, hints only
markdownlint = lib.optionalAttrs (!config.devenv.isTesting) {
enable = true;
files = "\.md$";
settings.configuration = {
MD013.line-length = 120;
MD024.siblings-only = true;
MD033 = false;
MD034 = false;
};
};
# disable this check when using ci, hints only
pre-commit-hook-ensure-sops = lib.optionalAttrs (!config.devenv.isTesting) {
enable = true;
files = "kubernetes/.*\.sops\.(toml|ya?ml)$";
};
check-added-large-files.enable = true;
check-merge-conflicts.enable = true;
check-executables-have-shebangs.enable = true;
};
};
# See full reference at https://devenv.sh/reference/options/
}