-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
50 lines (45 loc) · 1.41 KB
/
flake.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
{
description = "Minimal flake environment";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
};
outputs = { self, nixpkgs, flake-utils, pre-commit-hooks }:
with flake-utils.lib;
eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
checks = {
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = builtins.path {
path = ./.;
name = "Counter";
};
hooks = {
deadnix.enable = true;
nixpkgs-fmt.enable = true;
statix.enable = true;
pylint.enable = true;
flake8.enable = true;
};
};
};
devShells.default = pkgs.mkShell {
venvDir = "./.venv";
buildInputs = builtins.attrValues {
inherit (pkgs) python3;
inherit (pkgs.python3Packages) venvShellHook;
};
postVenvCreation = ''
unset SOURCE_DATE_EPOCH
# pip install -r Async/requirements.txt
pip install -r CounteR/requirements.txt
'';
preShellHook = ''
${self.checks.${system}.pre-commit-check.shellHook}
'';
};
formatter = pkgs.nixpkgs-fmt;
});
}