diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-09 10:55:01 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-09 10:56:07 +0200 |
commit | f3a8fab524e384e0b5cad3df6506a27b2f405ebc (patch) | |
tree | 33681a967a5ef759a66b6e5216048c5ba5f67160 /pkgs/impure/peertube/default.nix | |
parent | bf3b7671904b8a8bf4da4eba30564140387499f9 (diff) | |
download | Nix-f3a8fab524e384e0b5cad3df6506a27b2f405ebc.tar.gz Nix-f3a8fab524e384e0b5cad3df6506a27b2f405ebc.tar.zst Nix-f3a8fab524e384e0b5cad3df6506a27b2f405ebc.zip |
Add peertube (impure) derivation to pkgs
Diffstat (limited to 'pkgs/impure/peertube/default.nix')
-rw-r--r-- | pkgs/impure/peertube/default.nix | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/pkgs/impure/peertube/default.nix b/pkgs/impure/peertube/default.nix new file mode 100644 index 0000000..89fcb04 --- /dev/null +++ b/pkgs/impure/peertube/default.nix | |||
@@ -0,0 +1,58 @@ | |||
1 | { stdenv, fetchzip, cacert, mylibs, python, git, yarn, nodejs }: | ||
2 | let | ||
3 | # Doesn't seem to work | ||
4 | # patchedPackages = stdenv.mkDerivation (fetchedGithub ./peertube.json // rec { | ||
5 | # patches = [ ./ldap.patch ]; | ||
6 | # installPhase = '' | ||
7 | # mkdir $out | ||
8 | # cp package.json yarn.lock $out/ | ||
9 | # ''; | ||
10 | # }); | ||
11 | # yarnModules = pkgs.yarn2nix.mkYarnModules { | ||
12 | # name = "peertube-yarn-modules"; | ||
13 | # packageJSON = "${patchedPackages}/package.json"; | ||
14 | # yarnLock = "${patchedPackages}/yarn.lock"; | ||
15 | # yarnNix = ./yarn-packages.nix; | ||
16 | # }; | ||
17 | patchedServer = stdenv.mkDerivation (mylibs.fetchedGithub ./peertube.json // rec { | ||
18 | __noChroot = true; | ||
19 | patches = [ | ||
20 | ./ldap.patch | ||
21 | ./sendmail.patch | ||
22 | ]; | ||
23 | buildPhase = '' | ||
24 | export GIT_SSL_CAINFO=${cacert}/etc/ssl/certs/ca-bundle.crt | ||
25 | export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt | ||
26 | export HOME=$PWD | ||
27 | yarn install --pure-lockfile | ||
28 | npm run build:server | ||
29 | ''; | ||
30 | installPhase = '' | ||
31 | mkdir $out | ||
32 | cp -a dist/server $out | ||
33 | ''; | ||
34 | buildInputs = [ python git yarn nodejs ]; | ||
35 | }); | ||
36 | in | ||
37 | stdenv.mkDerivation rec { | ||
38 | __noChroot = true; | ||
39 | version = "v1.2.0"; | ||
40 | name = "peertube-${version}"; | ||
41 | src = fetchzip { | ||
42 | url = "https://github.com/Chocobozzz/PeerTube/releases/download/${version}/${name}.zip"; | ||
43 | sha256 = "18fp3fy1crw67gdpc29nr38b5zy2f68l70w47zwp7dzhd8bbbipp"; | ||
44 | }; | ||
45 | patches = [ ./ldap_yarn.patch ]; | ||
46 | buildPhase = '' | ||
47 | export GIT_SSL_CAINFO=${cacert}/etc/ssl/certs/ca-bundle.crt | ||
48 | export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt | ||
49 | export HOME=$PWD | ||
50 | yarn install --production --pure-lockfile | ||
51 | rm -rf dist/server && cp -a ${patchedServer}/server dist | ||
52 | ''; | ||
53 | installPhase = '' | ||
54 | mkdir $out | ||
55 | cp -a * $out | ||
56 | ''; | ||
57 | buildInputs = [ yarn git python ]; | ||
58 | } | ||