-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
114 lines (96 loc) · 2.82 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
{
description = "A type-centred purely functional programming language designed to type binary files";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
flake-linter = {
url = "gitlab:kira-bruneau/flake-linter";
inputs = {
flake-utils.follows = "flake-utils";
nixpkgs.follows = "nixpkgs";
};
};
nixpkgs.url = "nixpkgs/nixos-23.11";
crane = {
url = "github:ipetkov/crane";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
fenix = {
url = "github:nix-community/fenix";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
};
outputs = { self, flake-utils, flake-linter, nixpkgs, crane, fenix }:
let
lib = nixpkgs.lib;
systems = [ "x86_64-linux" ];
in
flake-utils.lib.eachSystem systems (system:
let
pkgs = import nixpkgs {
overlays = [
fenix.overlays.default
(final: prev: {
craneLib = crane.lib.${system};
craneLibLLvmTools = crane.lib.${system}.overrideToolchain
(fenix.packages.${system}.complete.withComponents [
"cargo"
"llvm-tools"
"rustc"
]);
})
];
inherit system;
};
callPackage = pkgs.newScope pkgs;
flake-linter-lib = flake-linter.lib.${system};
paths = flake-linter-lib.partitionToAttrs
flake-linter-lib.commonPaths
(flake-linter-lib.walkFlake ./.);
linter = flake-linter-lib.makeFlakeLinter {
root = ./.;
settings = {
markdownlint = {
paths = paths.markdown;
settings = {
default = true;
MD033 = {
allowed_elements = [ "img" "table" "tr" "th" "td" ];
};
};
};
nixpkgs-fmt.paths = paths.nix;
rustfmt.paths = paths.rust;
};
inherit pkgs;
};
in
{
packages = {
ari = callPackage ./nix/packages/ari.nix { };
default = self.packages.${system}.ari;
};
checks = {
inherit (self.packages.${system}.default)
clippy
coverage;
flake-linter = linter.check;
} // self.packages.${system};
apps = {
inherit (linter) fix;
};
devShells.default = self.packages.${system}.default.overrideAttrs (attrs: {
doCheck = true;
checkInputs = with pkgs; [
self.packages.${system}.default.clippy.nativeBuildInputs
self.packages.${system}.default.coverage.nativeBuildInputs
linter.nativeBuildInputs
nodePackages.markdown-link-check
];
});
}
);
}