-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
62 lines (59 loc) · 1.69 KB
/
flake.nix
File metadata and controls
62 lines (59 loc) · 1.69 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
{
description = "Development shell for green ecolution landing page";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
pre-commit-hooks.url = "github:cachix/git-hooks.nix";
};
outputs = {
self,
nixpkgs,
flake-utils,
...
} @ inputs: (flake-utils.lib.eachDefaultSystem
(
system: let
pkgs = nixpkgs.legacyPackages.${system};
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
eslint = {
language = "javascript";
args = ["--fix" "--ext" ".ts,.tsx"];
files = ["src/**/*.{ts,tsx}"];
};
prettier = {
args = ["--write"];
files = ["src/**/*.{js,jsx,ts,tsx,json,css,scss,md}"];
};
typescript = {
args = ["--noEmit" "--strict"];
files = ["src/**/*.{ts,tsx}"];
};
test = {
args = ["--bail" "--findRelatedTests"];
files = ["src/**/*.{test.js,test.ts,test.jsx,test.tsx}"];
};
pnpm-install = {
args = ["install"];
files = ["package.json" "pnpm-lock.yaml"];
};
};
};
in {
# devShells."x86_64-linux".default = import ./shell.nix { inherit pkgs; };
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
nodejs_24
pnpm
eslint
prettierd
docker
];
shellHook = ''
${pre-commit-check.shellHook}
'';
};
}
));
}