-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathflake.nix
More file actions
109 lines (99 loc) · 2.83 KB
/
flake.nix
File metadata and controls
109 lines (99 loc) · 2.83 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
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
{
description = "A CLI to generate vim/nvim help doc from emmylua";
nixConfig = {
extra-substituters = "https://mrcjkb.cachix.org";
extra-trusted-public-keys = "mrcjkb.cachix.org-1:KhpstvH5GfsuEFOSyGjSTjng8oDecEds7rbrI96tjA4=";
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
git-hooks = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ {
self,
nixpkgs,
flake-parts,
git-hooks,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
perSystem = {system, ...}: let
pkgs = import nixpkgs {
inherit system;
overlays = [
self.overlays.default
];
};
git-hooks-check = git-hooks.lib.${system}.run {
src = self;
hooks = {
alejandra.enable = true;
rustfmt.enable = true;
clippy = {
enable = true;
settings = {
denyWarnings = true;
allFeatures = true;
};
extraPackages = with pkgs.vimcats; buildInputs ++ nativeBuildInputs;
};
cargo-check.enable = true;
};
settings = {
rust.check.cargoDeps = pkgs.rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
};
};
};
in {
devShells.default = pkgs.mkShell {
name = "vimcats devShell";
buildInputs =
pkgs.vimcats.buildInputs
++ pkgs.vimcats.nativeBuildInputs
++ self.checks.${system}.git-hooks-check.enabledPackages
++ (with pkgs; [
rust-analyzer
cargo-nextest
]);
inherit (git-hooks-check) shellHook;
doCheck = false;
};
packages = rec {
default = vimcats;
inherit (pkgs) vimcats;
};
checks = rec {
default = git-hooks-check;
inherit git-hooks-check;
};
};
flake = {
overlays.default = final: prev: {
vimcats = final.rustPlatform.buildRustPackage {
pname = "vimcats";
src = self;
version = ((final.lib.importTOML "${self}/Cargo.toml").package).version;
cargoLock = {
lockFile = ./Cargo.lock;
};
buildFeatures = ["cli"];
meta = with final.lib; {
description = "CLI for generating vimdoc from LuaCATS annotations";
license = with licenses; [mit];
mainProgram = "vimcats";
};
};
};
};
};
}