-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
48 lines (45 loc) · 1.57 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# TODO pull nixpkgs from ./ortholang?
let
# fetch my pinned nixpkgs for reproducibility
# (ortholang-linux, dervived from nixpkgs-channels/nixos-19.09)
# pkgs = let inherit (import <nixpkgs> {}) stdenv fetchFromGitHub; in import (fetchFromGitHub {
# owner = "jefdaj";
# repo = "nixpkgs";
# rev = "89520e692736b1e7fc3926bbd52c4e1faaa16eb9";
# sha256 = "1vv5ydpckhsck5bm45hvlvbvn2nlxv2mpnqb82943p7vkwk87shy";
# }) {};
# use this instead to try to build it with your system's current nixpkgs:
pkgs = import <nixpkgs> {};
ortholang = import ./ortholang;
myPython = import ./requirements.nix { inherit pkgs; };
blastdbget = pkgs.pythonPackages.callPackage ./ortholang/nixpkgs/blastdbget {};
runDepends = [
myPython.interpreter
myPython.packages."Flask"
myPython.packages."Flask-Misaka"
myPython.packages."Flask-SocketIO"
myPython.packages."Flask-Twisted"
myPython.packages."Pygments"
myPython.packages."misaka"
myPython.packages."psutil"
myPython.packages."pexpect"
ortholang
blastdbget
];
in pkgs.stdenv.mkDerivation rec {
src = ./.;
version = "0.1";
name = "ortholang-demo-${version}";
inherit runDepends;
buildInputs = [ pkgs.makeWrapper ] ++ runDepends;
builder = pkgs.writeScript "builder.sh" ''
#!/usr/bin/env bash
source ${pkgs.stdenv}/setup
mkdir -p $out/src
cp -R $src/templates $src/static $out/src
mkdir -p $out/bin
dest="$out/bin/ortholang-demo"
install -m755 $src/ortholang-demo.py $dest
wrapProgram $dest --prefix PATH : "${pkgs.lib.makeBinPath runDepends}"
'';
}