-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
33 lines (29 loc) · 973 Bytes
/
shell.nix
File metadata and controls
33 lines (29 loc) · 973 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
{ pkgs ? import <nixpkgs> {} }:
let
electron = pkgs.electron;
in
pkgs.mkShell {
buildInputs = with pkgs; [
nodejs
electron
];
shellHook = ''
# Use the NixOS-patched Electron binary instead of the npm-bundled one.
# The npm 'electron' package checks this env var and uses it as the
# electron dist path, avoiding all FHS/sandbox/GPU issues on NixOS.
export ELECTRON_OVERRIDE_DIST_PATH="${electron}/bin"
echo ""
echo "🖥️ ECA Desktop dev shell"
echo " Node: $(node --version)"
echo " Electron: $(electron --version)"
echo ""
echo " nix-shell --run 'npm start' — single command run"
echo " npm run dev — dev mode (hot-reload)"
echo " npm run build — build for production"
echo " npm start — run production build"
echo ""
'';
}
# Single-command usage:
# nix-shell --run "npm start"
# nix-shell --run "npm run dev"