forked from monogramdesign/idx-react-native
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdevNix.j2
More file actions
71 lines (71 loc) · 2.26 KB
/
devNix.j2
File metadata and controls
71 lines (71 loc) · 2.26 KB
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
{% set perPackageManager = {
"npm": {
"packages": "pkgs.nodejs_20",
"install": "npm ci --prefer-offline --no-audit --no-progress --timing && npm i @expo/ngrok@^4.1.0",
"previewWebPrefix": "\"npm\" \"run\" \"web\" \"--\"",
"previewAndroidPrefix": "npm run android --"
},
"bun": {
"packages": "pkgs.bun",
"install": "bun i @expo/ngrok@^4.1.0",
"previewWebPrefix": "\"bun\" \"web\"",
"previewAndroidPrefix": "bun android"
},
"pnpm": {
"packages": "pkgs.nodePackages.pnpm",
"install": "pnpm add @expo/ngrok@^4.1.0",
"previewWebPrefix": "\"pnpm\" \"web\"",
"previewAndroidPrefix": "pnpm android"
},
"yarn": {
"packages": "pkgs.yarn",
"install": "yarn && yarn add @expo/ngrok@^4.1.0",
"previewWebPrefix": "\"yarn\" \"web\"",
"previewAndroidPrefix": "yarn android"
},
}[packageManager]%}# To learn more about how to use Nix to configure your environment
# see: https://developers.google.com/idx/guides/customize-idx-env
{ pkgs, ... }: {
# Which nixpkgs channel to use.
channel = "stable-23.11"; # or "unstable"
# Use https://search.nixos.org/packages to find packages
packages = [{{perPackageManager.packages}}];
# Sets environment variables in the workspace
env = {};
idx = {
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
extensions = [
"msjsdiag.vscode-react-native"
];
workspace = {
# Runs when a workspace is first created with this `dev.nix` file
onCreate = {
install = "{{perPackageManager.install}}";
};
# Runs when a workspace restarted
onStart = {
connect-device = ''
adb -s localhost:5554 wait-for-device
'';
android = ''
{{perPackageManager.previewAndroidPrefix}} --port 5554 --tunnel
'';
};
};
# Enable previews and customize configuration
previews = {
enable = true;
previews = {
web = {
command = [{{perPackageManager.previewWebPrefix}} "--port" "$PORT"];
manager = "web";
};
android = {
# noop
command = ["tail" "-f" "/dev/null"];
manager = "web";
};
};
};
};
}