mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-02-20 00:33:07 +01:00
49 lines
1.7 KiB
Nix
49 lines
1.7 KiB
Nix
# the last successful build of nixpkgs-unstable as of 2021-11-16
|
|
with import
|
|
(builtins.fetchTarball {
|
|
url = "https://github.com/NixOS/nixpkgs/archive/5cb226a06c49f7a2d02863d0b5786a310599df6b.tar.gz";
|
|
sha256 = "0dzz207swwm5m0dyibhxg5psccrcqfh1lzkmzzfns27wc4ria6z3";
|
|
})
|
|
{ };
|
|
|
|
let
|
|
electron = electron_15; # use the same version as defined in packages/suite-desktop/package.json
|
|
in
|
|
stdenv.mkDerivation {
|
|
name = "trezor-suite-dev";
|
|
buildInputs = [
|
|
bash
|
|
git-lfs
|
|
gnupg
|
|
mdbook
|
|
xorg.xhost # for e2e tests running on localhost
|
|
docker # for e2e tests running on localhost
|
|
docker-compose # for e2e tests running on localhost
|
|
nodejs
|
|
yarn
|
|
jre
|
|
p7zip
|
|
electron
|
|
pkg-config
|
|
pixman cairo giflib libjpeg libpng librsvg pango # build dependencies for node-canvas
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
appimagekit nsis openjpeg osslsigncode p7zip squashfsTools # binaries used by node_module: electron-builder
|
|
# winePackages.minimal
|
|
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
|
|
Cocoa
|
|
CoreServices
|
|
]);
|
|
shellHook = ''
|
|
export NODE_OPTIONS=--max_old_space_size=4096
|
|
export CURDIR="$(pwd)"
|
|
export PATH="$PATH:$CURDIR/node_modules/.bin"
|
|
export ELECTRON_BUILDER_CACHE="$CURDIR/.cache/electron-builder"
|
|
export USE_SYSTEM_7ZA=true
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
export ELECTRON_OVERRIDE_DIST_PATH="${electron}/Applications/"
|
|
'' + lib.optionalString stdenv.isLinux ''
|
|
export ELECTRON_OVERRIDE_DIST_PATH="${electron}/bin/"
|
|
export npm_config_build_from_source=true # tell yarn to not download binaries, but build from source
|
|
'';
|
|
}
|