Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
106 lines (106 loc) · 3.21 KB
/
Copy pathflake.nix
File metadata and controls
106 lines (106 loc) · 3.21 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
pre-commit-hooks.url = "github:cachix/git-hooks.nix";
pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{
self,
nixpkgs,
pre-commit-hooks,
...
}:
let
eachSystem = nixpkgs.lib.genAttrs [ "x86_64-linux" ];
in
{
packages = eachSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
in
rec {
vgarchive = pkgs.callPackage ./nix/package.nix { };
validate-pyproject = pkgs.callPackage ./nix/validate-pyproject.nix {
inherit validate-pyproject-schema-store;
};
validate-pyproject-schema-store = pkgs.callPackage ./nix/validate-pyproject-schema-store.nix { };
default = vgarchive;
}
);
devShells = eachSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
validate-pyproject = self.packages.${system}.validate-pyproject;
in
{
default = pkgs.mkShell {
inherit (self.checks.${system}.pre-commit-check) shellHook;
buildInputs =
with pkgs;
[
(python3.withPackages (
ps: with ps; [
brotli
fonttools
tinycss2
uharfbuzz
zopfli
]
))
caddy
djlint
just
lightningcss
nixfmt-rfc-style
nodejs
pre-commit
ruff
uv
validate-pyproject
sqlite
]
++ self.checks.${system}.pre-commit-check.enabledPackages
++ validate-pyproject.optional-dependencies.all
++ validate-pyproject.optional-dependencies.store;
};
}
);
checks = eachSystem (system: {
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
# pre-defined hooks
check-added-large-files.enable = true;
check-executables-have-shebangs.enable = true;
check-shebang-scripts-are-executable.enable = true;
check-symlinks.enable = true;
end-of-file-fixer.enable = true;
nixfmt-rfc-style.enable = true;
pyright.enable = true;
pyright.excludes = [ "^.*migrations/" ];
ruff-format.enable = true;
ruff-format.excludes = [ "^.*migrations/" ];
ruff.enable = true;
# Custom hooks
djlint-django = {
enable = true;
name = "djLint Linting for Django";
entry = "djlint --profile=django";
language = "python";
types = [ "html" ];
};
djlint-reformat-django = {
enable = true;
name = "djLint Linting for Django";
entry = "djlint --reformat --profile=django";
language = "python";
types = [ "html" ];
};
};
};
});
};
}