-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathflake.nix
93 lines (85 loc) · 2.15 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
{
description = "PureScript language support for Vim and Neovim";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs =
{ self
, nixpkgs
, ...
}@inputs:
let
projectName = "purescript-vim";
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
});
in
{
overlays.default = final: prev: { };
apps = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
in
{
format = {
type = "app";
program = pkgs.writeShellApplication
{
name = "format";
runtimeInputs = with pkgs; [
nixpkgs-fmt
];
text = ''
set -euo pipefail
cd ${self}
nixpkgs-fmt .
'';
} + "/bin/format";
};
});
checks = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
in
{
editorconfig = pkgs.runCommand "editorconfig-checker"
{
src = self;
nativeBuildInputs = with pkgs; [
editorconfig-checker
nixpkgs-fmt
vim-vint
];
} ''
set -euo pipefail
cd ${self}
editorconfig-checker | tee $out
nixpkgs-fmt --check . | tee $out
vint --style-problem **/*.vim | tee $out
'';
});
devShells = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
in
{
default = pkgs.mkShell {
name = projectName;
buildInputs = with pkgs; [
editorconfig-checker
nixpkgs-fmt
nodejs # for npx in generate-doc.sh
vim-vint
];
};
});
};
}