-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathshell.nix
76 lines (74 loc) · 1.75 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
let
desk-path = "/mnt/laptop-sandisk/distem-bottus-littel-wolfur/citadel";
interface-path = "ui";
npm-scripts = rec {
inherit scripts;
start = writeShellScriptBin "start" ''
npm run start --prefix ${interface-path}
'';
build = writeShellScriptBin "build" ''
npm run build --prefix ${interface-path}
'';
install = writeShellScriptBin "setup" ''
npm install --prefix ${interface-path}
'';
run = writeShellScriptBin "run" ''
npm run --prefix ${interface-path}
'';
};
scripts = {
# Print all npm scripts
nss = writeShellScriptBin "nss" ''
jq ".scripts" ${interface-path}/package.json
'';
# Watch a repo for changes and copy it to `desk-path`
urbit-watch = writeShellScriptBin "urbit-watch" ''
watch cp -RL ./desk/* ${desk-path}
'';
};
yarn-scripts = rec {
inherit scripts;
start = writeShellScriptBin "start" ''
yarn --cwd ${interface-path} start
'';
build = writeShellScriptBin "build" ''
yarn --cwd ${interface-path} build
'';
install = writeShellScriptBin "setup" ''
yarn --cwd ${interface-path} install
'';
run = writeShellScriptBin "run" ''
yarn --cwd ${interface-path} run
'';
};
in mkShell {
# buildInputs = with npm-scripts; [
# nodejs
# jq
# scripts.urbit-watch
# build
# start
# install
# run
# scripts.nss
# ]
# ;
buildInputs = with yarn-scripts; [
nodejs
yarn
jq
scripts.urbit-watch
build
start
install
run
scripts.nss
];
shellHook = ''
export PATH="$PWD/${interface-path}/node_modules/.bin/:$PATH"
# save shell history in project folder
HISTFILE=${toString ./.history}
'';
}