forked from mrcjkb/haskell-snippets.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
executable file
·121 lines (106 loc) · 2.56 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
115
116
117
118
119
120
121
{
description = "My collection of Haskell snippets for LuaSnip";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
flake-utils.url = "github:numtide/flake-utils";
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
plenary-nvim = {
url = "github:nvim-lua/plenary.nvim";
flake = false;
};
};
outputs = {
self,
nixpkgs,
flake-utils,
pre-commit-hooks,
neovim-nightly-overlay,
plenary-nvim,
...
}: let
name = "haskell-snippets.nvim";
plugin-overlay = import ./nix/plugin-overlay.nix {
inherit name self;
};
supportedSystems = [
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
"x86_64-linux"
];
in
flake-utils.lib.eachSystem supportedSystems (system: let
ci-overlay = import ./nix/ci-overlay.nix {
inherit
self
plenary-nvim
;
};
pkgs = import nixpkgs {
inherit system;
overlays = [
ci-overlay
neovim-nightly-overlay.overlay
plugin-overlay
];
};
docgen = pkgs.callPackage ./nix/docgen.nix {};
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = self;
hooks = {
alejandra.enable = true;
stylua.enable = true;
luacheck.enable = true;
editorconfig-checker.enable = true;
markdownlint.enable = true;
};
};
devShell = pkgs.mkShell {
name = "haskell-snippets-devShell";
inherit (pre-commit-check) shellHook;
buildInputs = with pre-commit-hooks.packages.${system}; [
alejandra
lua-language-server
stylua
luacheck
editorconfig-checker
markdownlint-cli
];
};
in {
devShells = {
default = devShell;
inherit devShell;
};
packages = rec {
default = haskell-snippets-nvim;
inherit docgen;
inherit
(pkgs)
haskell-snippets-nvim
;
};
checks = {
formatting = pre-commit-check;
inherit
(pkgs)
nvim-stable-tests
nvim-nightly-tests
;
};
})
// {
overlays.default = plugin-overlay;
};
}