Skip to content

Instantly share code, notes, and snippets.

@cessationoftime
Created June 1, 2017 22:23
Show Gist options
  • Save cessationoftime/b88e87afcf8e55e4cc5f11cb5dc12673 to your computer and use it in GitHub Desktop.
Save cessationoftime/b88e87afcf8e55e4cc5f11cb5dc12673 to your computer and use it in GitHub Desktop.
{ pkgs ? import <nixpkgs> {} }: with pkgs;
stdenv.mkDerivation {
name = "frontend";
src = ../.;
buildInputs = [ elmPackages.elm nodejs nodePackages.yarn ];
HOME=".";
patchPhase = ''
cd frontend
if [ ! -d "node_modules" ]; then
yarn
fi
patchShebangs node_modules/webpack
'';
buildPhase = ''
if [ -d "dist" ]; then
rm ./dist -r
fi
node node_modules/webpack/bin/webpack.js
'';
installPhase = ''
mkdir $out
cp -r dist/* $out/
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment