-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
82 lines (73 loc) · 2.18 KB
/
flake.nix
File metadata and controls
82 lines (73 loc) · 2.18 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
{
description = "Dev shell and Linting";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
precommit = {
url = "github:FredSystems/pre-commit-checks";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
precommit,
...
}:
let
systems = precommit.lib.supportedSystems;
inherit (nixpkgs) lib;
in
{
##########################################################################
## PRE-COMMIT CHECKS
##########################################################################
checks = lib.genAttrs systems (system: {
pre-commit = precommit.lib.mkCheck {
inherit system;
src = ./.;
# ── Feature toggles ─────────────────────────────
check_rust = false;
check_docker = false;
check_python = false;
# Rust-specific knobs (safe to leave here)
enableXtask = false;
# Python-specific knobs (safe to leave here)
python = {
enableBlack = true;
enableFlake8 = true;
};
};
});
##########################################################################
## DEV SHELL
##########################################################################
devShells = lib.genAttrs systems (
system:
let
pkgs = import nixpkgs { inherit system; };
chk = self.checks.${system}.pre-commit;
in
{
default = pkgs.mkShell {
buildInputs =
chk.enabledPackages
++ (chk.passthru.devPackages or [ ])
++ (with pkgs; [
pre-commit
check-jsonschema
codespell
typos
nixfmt
nodePackages.markdownlint-cli2
]);
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (chk.passthru.libPath or [ ]);
shellHook = ''
${chk.shellHook}
alias pre-commit="pre-commit run --all-files"
'';
};
}
);
};
}