-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdev
More file actions
executable file
·18 lines (16 loc) · 781 Bytes
/
Copy pathdev
File metadata and controls
executable file
·18 lines (16 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash
# Start the dev server on NixOS.
#
# Two things make a bare `yarn dev` fail here:
# 1. No node, npx, or real yarn on PATH. The ~/.local/bin/yarn shim execs npx
# and dies with "exec: npx: not found".
# 2. node_modules/electron/dist/electron is a generic-linux prebuilt that NixOS
# cannot execute. dev-runner calls require('electron') for the binary path,
# and node_modules/electron/index.js honours ELECTRON_OVERRIDE_DIST_PATH, so
# pointing that at the nixpkgs electron makes it spawn the wrapper instead.
#
# Usage: ./dev
set -euo pipefail
electron_bin="$(nix build nixpkgs#electron --no-link --print-out-paths)/bin"
exec nix shell nixpkgs#nodejs nixpkgs#yarn --command \
env ELECTRON_OVERRIDE_DIST_PATH="$electron_bin" yarn dev