-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathshell.nix
More file actions
38 lines (33 loc) · 829 Bytes
/
shell.nix
File metadata and controls
38 lines (33 loc) · 829 Bytes
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
{
pkgs ? import ./pkgs.nix
}:
with pkgs;
let
nodeVersion = "12";
drv = callPackage ./default.nix {};
in
drv.overrideAttrs (attrs: {
src = null;
nativeBuildInputs = [
nodePackages.node2nix
] ++ (lib.attrByPath [ "nativeBuildInputs" ] [] attrs);
shellHook = ''
echo 'Entering ${attrs.name}'
set -o allexport
. ./.env
set +o allexport
set -v
export PATH="$(pwd)/dist/bin:$(npm bin):$PATH"
# setting up for nix-build
npm install --package-lock-only
node2nix \
--input package.json \
--lock package-lock.json \
--node-env ./nix/node-env.nix \
--output ./nix/node-packages.nix \
--composition ./nix/default.nix \
--nodejs-${nodeVersion}
mkdir --parents "$(pwd)/tmp"
set +v
'';
})