Advertisement
Guest User

default.nix

a guest
Apr 10th, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. { pkgs ? (import <nixpkgs> {}) }:
  2. let
  3. python = import ./requirements.nix { inherit pkgs; };
  4. in pkgs.stdenv.mkDerivation {
  5. name = "todo-backend-flask";
  6. src = ./todo-backend-flask;
  7.  
  8. buildInputs = [pkgs.makeWrapper];
  9. propagatedBuildInputs = builtins.attrValues python.packages;
  10.  
  11. builder = "${pkgs.bash}/bin/bash";
  12. args = ["-c" ''
  13.  
  14. source $stdenv/setup
  15. mkdir -p $out/{bin,src}
  16. cp -rv ${./.}/* $out/src/
  17.  
  18. makeWrapper \
  19. ${python.packages.gunicorn}/bin/gunicorn \
  20. $out/bin/todo-server \
  21. --prefix PATH : ${./todo-backend-flask} \
  22. --add-flags todo:app
  23. ''];
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement