Skip to content

Commit

Permalink
fix: electron build in NixOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Jos van Bakel committed Nov 22, 2018
1 parent 57e56fd commit d9dc035
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ unset TEMP

PATH_add node_modules/.bin

# replace broken optipng with nix version.
if optipng=$(which optipng); then
mkdir -p node_modules/optipng-bin/vendor
rm -f node_modules/.bin/optipng node_modules/optipng-bin/vendor/optipng
ln -sf $optipng node_modules/optipng-bin/vendor/optipng
fi
function replace {
if file=$(which $1); then
mkdir -p $(basename $2)
rm -f node_modules/.bin/$1 $2
ln -sf $file $2
fi
}

replace optipng node_modules/optipng-bin/vendor/optipng
replace electron node_modules/electron/dist/electron

export OVERRIDE_CHROMIUM_PATH=$(which chromium)
2 changes: 2 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ mkShell {
optipng
gifsicle
libjpeg # for jpegtran

electron
];
}

0 comments on commit d9dc035

Please sign in to comment.