Skip to content

Commit 32240d0

Browse files
committed
chore: add commit hooks based on flake
1 parent 9758a2c commit 32240d0

File tree

5 files changed

+136
-34
lines changed

5 files changed

+136
-34
lines changed

.github/workflows/automerge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ name: automerge
1010
permissions:
1111
contents: write
1212
pull-requests: write
13+
issues: write
1314

1415
jobs:
1516
dependabot:

.gitignore

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
.direnv
2-
.devenv
1+
.direnv/
2+
.devenv/
33

4-
/typings
5-
/dist
6-
/node_modules
4+
typings/
5+
dist/
6+
node_modules/
7+
8+
.pre-commit-config.yaml

flake.lock

Lines changed: 75 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 46 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@
1313
flake-parts = {
1414
url = "github:hercules-ci/flake-parts";
1515
};
16+
17+
git-hooks = {
18+
url = "github:cachix/git-hooks.nix";
19+
};
1620
};
1721

18-
outputs = inputs@{ flake-parts, ... }:
22+
outputs =
23+
inputs@{ flake-parts, ... }:
1924
flake-parts.lib.mkFlake { inherit inputs; } {
2025
imports = [
2126
inputs.devenv.flakeModule
@@ -28,32 +33,50 @@
2833
"aarch64-darwin"
2934
];
3035

31-
perSystem = { config, self', inputs', pkgs, system, ... }: {
32-
imports = [
33-
{
34-
_module.args.pkgs = import inputs.nixpkgs {
35-
inherit system;
36-
config.allowUnfree = true;
37-
};
38-
}
39-
];
40-
41-
devenv = {
42-
shells = {
43-
default = {
44-
languages = {
45-
javascript = {
46-
enable = true;
47-
package = pkgs.nodejs_20;
48-
};
36+
perSystem =
37+
{
38+
config,
39+
self',
40+
inputs',
41+
pkgs,
42+
system,
43+
...
44+
}:
45+
{
46+
imports = [
47+
{
48+
_module.args.pkgs = import inputs.nixpkgs {
49+
inherit system;
50+
config.allowUnfree = true;
4951
};
52+
}
53+
];
5054

51-
packages = with pkgs; [
52-
openapi-generator-cli
53-
];
55+
devenv = {
56+
shells = {
57+
default = {
58+
git-hooks = {
59+
hooks = {
60+
nixfmt-rfc-style = {
61+
enable = true;
62+
};
63+
};
64+
};
65+
66+
languages = {
67+
javascript = {
68+
enable = true;
69+
package = pkgs.nodejs_20;
70+
};
71+
};
72+
73+
packages = with pkgs; [
74+
nixfmt-rfc-style
75+
openapi-generator-cli
76+
];
77+
};
5478
};
5579
};
5680
};
57-
};
5881
};
5982
}

hack/openapi/templates/gitignore

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
.direnv
2-
.devenv
1+
.direnv/
2+
.devenv/
33

4-
/typings
5-
/dist
6-
/node_modules
4+
typings/
5+
dist/
6+
node_modules/
7+
8+
.pre-commit-config.yaml

0 commit comments

Comments
 (0)