-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
54 lines (44 loc) · 1.19 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
{
description = "Development environment for nvim-atlas";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils.url =
"github:numtide/flake-utils/1ef2e671c3b0c19053962c07dbda38332dcebf26";
};
outputs = { self, nixpkgs, flake-utils, }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
make-all = pkgs.writeShellScriptBin "make-all" ''
if [ $# -eq 0 ]
then
set -- make test lint fmt
fi
if "$@"
then
c=42
else
c=41
fi
printf '\e[%dm\e[K\e[m\n' $c
test $c -ne 41
'';
watch = pkgs.writeShellScriptBin "watch" ''
exec ${pkgs.watchexec}/bin/watchexec --restart --quiet -n \
-- ${make-all}/bin/make-all "$@"
'';
in {
formatter = pkgs.nixfmt-classic;
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
gnumake
lua-language-server
luajitPackages.luacheck
ripgrep
stylua
watch
watchexec
];
};
});
}