mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-15 11:49:57 +01:00
52 lines
1.8 KiB
Nix
52 lines
1.8 KiB
Nix
# the last successful build of nixpkgs-unstable as of 2022-05-31
|
|
with import
|
|
(builtins.fetchTarball {
|
|
url = "https://github.com/NixOS/nixpkgs/archive/b62ada430501de88dfbb08cea4eb98ead3a5e3e7.tar.gz";
|
|
sha256 = "1ppaixbncqyvy2ixskwvzggjsw20j77iy3aqyk4749dvkx0ml27f";
|
|
})
|
|
{ };
|
|
|
|
let
|
|
# unstable packages
|
|
electron = electron_18; # use the same version as defined in packages/suite-desktop/package.json
|
|
nodejs = nodejs-16_x;
|
|
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
|
|
shellcheck
|
|
] ++ 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
|
|
'';
|
|
}
|