-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
85 lines (73 loc) · 1.92 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
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
{
description = ''
A linting framework designed to run checks & fixes incrementally
in your project (using Nix flakes)
'';
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
};
outputs =
{
self,
flake-utils,
nixpkgs,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
flake-linter-lib = self.lib.${system};
paths = flake-linter-lib.partitionToAttrs {
inherit (flake-linter-lib.commonPaths)
bash
markdown
nix
rust
;
} (flake-linter-lib.walkFlake ./.);
linter = flake-linter-lib.makeFlakeLinter {
root = ./.;
settings = {
markdownlint = {
paths = paths.markdown;
settings = {
MD013 = false;
};
};
nixf-tidy-fix = {
paths = paths.nix;
settings = {
variable-lookup = true;
};
};
nixfmt-rfc-style.paths = paths.nix;
rustfmt.paths = paths.rust;
shfmt = {
paths = paths.bash;
settings = {
indent = 2;
};
};
};
};
in
{
checks = {
flake-linter = linter.check;
};
lib = import ./lib pkgs;
apps = {
inherit (linter) fix;
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = linter.nativeBuildInputs ++ [
# markdown-lint-check isn't included in flake-linter
# because it requires internet access. I'm considering
# implementing an "offline mode" for it so we can.
pkgs.nodePackages.markdown-link-check
];
};
}
);
}