forked from rainlanguage/arb-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
57 lines (48 loc) · 1.28 KB
/
shell.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
let
pkgs = import
(builtins.fetchTarball {
name = "nixos-unstable-2022-09-26";
url = "https://github.com/nixos/nixpkgs/archive/b8e83fd7e16529ee331313993508c3bf918f1d57.tar.gz";
sha256 = "1a98pgnhdhyg66176i36rcn3rklihy36y9z4176la7pxlzm4khwf";
})
{ };
local-test = pkgs.writeShellScriptBin "local-test" ''
npm test
'';
flush = pkgs.writeShellScriptBin "flush" ''
rm -rf node_modules
'';
ci-test = pkgs.writeShellScriptBin "ci-test" ''
flush
npm install --ignore-scripts
local-test
'';
docgen = pkgs.writeShellScriptBin "docgen" ''
npm run docgen
'';
lint = pkgs.writeShellScriptBin "lint" ''
npm run lint
'';
lint-fix = pkgs.writeShellScriptBin "lint-fix" ''
npm run lint-fix
'';
in
pkgs.stdenv.mkDerivation {
name = "shell";
buildInputs = [
pkgs.watch
pkgs.nixpkgs-fmt
pkgs.nodejs-18_x
local-test
ci-test
flush
docgen
lint
lint-fix
];
shellHook = ''
export PATH=$( npm bin ):$PATH
# keep it fresh
npm install --ignore-scripts
'';
}