-
Notifications
You must be signed in to change notification settings - Fork 5
/
default.nix
53 lines (40 loc) · 1.32 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
49
50
51
52
53
{ pkgs, system, stdenv, fetchFromGitHub, go, nodejs-8_x, bash, apktool, python27Packages }:
let
pqsrc = fetchFromGitHub {
owner = "lib";
repo = "pq";
rev = "e42267488fe361b9dc034be7a6bffef5b195bceb";
sha256 = "082s0kb0qi1m32nq6jsnrn9wsiwm7pljhn9mh4sgkqajsxp830yk";
};
crap = import ./pipeline/default.nix { inherit pkgs system; };
nodeDependencies = crap.shell.nodeDependencies;
in
stdenv.mkDerivation rec {
name = "xray-${version}";
version = "0.1.0";
buildInputs = [ go nodejs-8_x bash nodeDependencies ];
propagatedBuildInputs = [ apktool python27Packages.gplaycli ];
srcs = ./pipeline;
patchPhase = ''
patchShebangs scripts/install.sh
'';
configurePhase = ''
cd "$NIX_BUILD_TOP"
mkdir goPath
(cd goPath; unpackFile "${pqsrc}")
mkdir -p "go/src/github.com/lib"
chmod -R u+w goPath
mv goPath/* "go/src/github.com/lib/pq"
rmdir goPath
mkdir -p "go/src/github.com/sociam/xray-archiver"
mv pipeline "go/src/github.com/sociam/xray-archiver"
cd go/src/github.com/sociam/xray-archiver/pipeline
rm -rf node_modules
[[ -d ${nodeDependencies}/lib/node_modules ]]
ln -s ${nodeDependencies}/lib/node_modules .
export GOPATH="$NIX_BUILD_TOP/go:$GOPATH"
'';
preInstall = ''
export makeFlagsArray=(PREFIX="$out" INSTALLFLAGS="-n")
'';
}