-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
46 lines (41 loc) · 1.18 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
{
inputs = {
nixpkgs-matrix-private = {
type = "indirect";
id = "nixpkgs-matrix-private";
};
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs-matrix-private, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs-matrix-private.legacyPackages.${system};
shell = { ci ? false }:
with pkgs;
mkShell {
nativeBuildInputs = [ nodejs shellcheck git-lfs ];
shellHook = ''
echo "Entering $(npm pkg get name)"
set -o allexport
. ./.env
set +o allexport
set -v
${lib.optionalString ci ''
set -o errexit
set -o nounset
set -o pipefail
shopt -s inherit_errexit
''}
mkdir --parents "$(pwd)/tmp"
export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH"
npm install --ignore-scripts
set +v
'';
};
in {
devShells = {
default = shell { ci = false; };
ci = shell { ci = true; };
};
});
}