-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathshell.nix
More file actions
73 lines (72 loc) · 1.8 KB
/
shell.nix
File metadata and controls
73 lines (72 loc) · 1.8 KB
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
73
{
pkgs ? import <nixpkgs> { },
system,
inputs,
}:
let
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
#general stuff
end-of-file-fixer.enable = true;
trim-trailing-whitespace.enable = true;
check-merge-conflicts.enable = true;
check-symlinks.enable = true;
codespell = {
enable = true;
name = "codespell";
excludes = [ "^secrets/" ];
entry = "${pkgs.codespell}/bin/codespell -w --ignore-words-list=hass,edn,pinchin,bootup";
};
#nix
nixfmt.enable = true;
#bash
shellcheck = {
enable = true;
excludes = [
".envrc"
];
};
shfmt.enable = true;
#python
check-docstring-first.enable = true;
check-builtin-literals.enable = true;
check-python.enable = true;
python-debug-statements.enable = true;
ruff.enable = true;
ruff-format = {
enable = true;
args = [
"--line-length"
"100"
];
};
#sops
pre-commit-hook-ensure-sops.enable = true;
};
};
myPythonPackages =
ps: with ps; [
bonsai # for development of hass ldap script
];
in
pkgs.mkShell {
buildInputs =
with pkgs;
[
sops
nebula
(callPackage ./generic/packages/createNebulaDevice/package.nix { })
(callPackage ./generic/packages/deployment/package.nix { })
(python313.withPackages myPythonPackages)
]
++ pre-commit-check.enabledPackages;
shellHook = ''
localOverwriteFile=".pre-commit-config.yaml"
if ! grep -q "This file was generated by git-hooks.nix" "$localOverwriteFile"; then
git update-index --skip-worktree "$localOverwriteFile"
rm "$localOverwriteFile"
fi
''
+ pre-commit-check.shellHook;
}