Skip to content

Instantly share code, notes, and snippets.

@nocoolnametom
Forked from cessationoftime/frontend.nix
Created June 1, 2017 22:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nocoolnametom/649b587a944eb972bd59cfb8a021f54b to your computer and use it in GitHub Desktop.
Save nocoolnametom/649b587a944eb972bd59cfb8a021f54b 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