-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathshell.nix
More file actions
35 lines (30 loc) · 977 Bytes
/
Copy pathshell.nix
File metadata and controls
35 lines (30 loc) · 977 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
let
pkgs = import <nixpkgs> { };
buildInputs = with pkgs; [
# Node tooling
nodejs_24
p7zip
unar # For unpacking RAR and other archive formats
];
in
pkgs.mkShell {
inherit buildInputs;
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
shellHook = ''
echo "Node: $(node --version)"
echo "npm: $(npm --version)"
# When building native Electron modules, use Electron headers matching our electron version
export npm_config_runtime=electron
export npm_config_target=35.0.0
export npm_config_disturl=https://electronjs.org/headers
export USE_SYSTEM_7ZA=true
export ELECTRON_BINARY="$PWD/.electron"
cat > "$ELECTRON_BINARY" <<'EOF'
#!/usr/bin/env bash
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath buildInputs}
export USE_SYSTEM_7ZA=true
exec "${pkgs.electron}/bin/electron" "$@" "--enable-features=UseOzonePlatform" "--ozone-platform=x11"
EOF
chmod +x "$ELECTRON_BINARY"
'';
}