Created
April 29, 2018 03:40
-
-
Save Rizary/10b6b2f51f4681cb3e51568dd222ea1a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ nixpkgs ? import <nixpkgs> {} | |
}: | |
let | |
inherit (nixpkgs) pkgs; | |
activate = pkgs.writeScriptBin "activate" '' | |
#!${pkgs.bash}/bin/bash -e | |
''; | |
frontend = import ./frontend {}; | |
backend = import ./backend {}; | |
in | |
pkgs.stdenv.mkDerivation rec { | |
name = "qoeifs-app"; | |
src = ./.; | |
env = pkgs.buildEnv { name = name; paths = buildInputs; }; | |
installPhase = '' | |
mkdir -p $out/prod/static | |
cp -rf ${frontend}/ghcjs/frontend/bin/frontend-exe.jsexe/* $out/prod/static/ | |
cp -r ./static/test.css $out/prod/static | |
cp -rf ${backend.package}/lib/node_modules/backend/result/lib/node_modules/backend/* $out/prod/ | |
mkdir -p $out/bin | |
ln -sv ${activate}/bin/activate $out/bin/ | |
''; | |
phases = ["unpackPhase" "installPhase"]; | |
buildInputs = [ frontend backend pkgs.nodePackages.nodemon]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ nixpkgs ? import <nixpkgs> {}}: | |
let | |
inherit (nixpkgs) pkgs; | |
app = import ./default.nix {}; | |
in | |
app.env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment