generated from nix-community/nur-packages-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
112 lines (93 loc) · 3.33 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# nix-build -E 'with import <nixpkgs> { }; callPackage ./default.nix { }'
# ./result/bin/aether-frontend run
# based on
# https://gist.github.com/nehbit/4a8c3d81d543e85c9df974f521732b1e
# https://getaether.net/docs/developers/
# https://meta.getaether.net/t/building-from-source-on-arch-linux/244
{ lib
, stdenv
, fetchFromGitHub
, electron_11
, buildGoModule
, callPackage # nodeDependencies
}:
let
/* TODO use node from electron_11?
# nodejs-11_x was removed, EOL 2019-06-01 https://github.com/NixOS/nixpkgs/pull/70256
# this will take some minutes to compile ...
nodejs-11_x = (import (builtins.fetchGit {
# https://lazamar.co.uk/nix-versions/?channel=nixpkgs-unstable&package=nodejs
name = "nixpkgs-nodejs-11.15.0"; # name in nix store
url = "https://github.com/NixOS/nixpkgs/";
ref = "refs/heads/nixpkgs-unstable";
rev = "84f318e323989435d5dd54b4038b0af728f20c85";
}) {}).nodejs-11_x;
*/
aether-repo = "aether-app";
aether-version = "2.0.0-dev.15";
/* build error
aether-owner = "aethereans";
aether-rev = "53b6c8b2a9253cbf056ea3ebb077e0e08cbc5b1d";
aether-sha256 = "1kgkzh7ih2q9dsckdkinh5dbzvr7gdykf8yz6h8pyhvzyjhk1v0r";
*/
# fix inconsistent vendoring
# fix some go tests, disable many go tests (FIXME)
aether-owner = "milahu";
aether-rev = "74d4a3875486306443d799278942174b23bb9aeb";
aether-sha256 = "0vbyrk72vs4kk7ajpk7sl6j6vfq474xqrjlwkb8jqm00x03ykk2h";
aether-path = "github.com/${aether-owner}/${aether-repo}";
aether-url = "https://${aether-path}";
aether-gomodules = buildGoModule rec {
pname = "aether-gomodules";
version = aether-version;
src = fetchFromGitHub {
owner = aether-owner;
repo = aether-repo;
rev = aether-rev;
sha256 = aether-sha256;
} + "/aether-core"; # the go.mod file is in /aether-core
vendorHash = "042q726cnvz8igjkkw22qh7196wfhpy2k3d0xhmdpjqp6rfryy9m";
runVend = true; # rewrite vendor folder?
# fix: mkdir /homeless-shelter: permission denied
preBuild = ''
export HOME=/tmp
'';
};
# node-default.nix is generated by running node2nix in aether-core/aether/client
# error: package.json not found -> aether-core/aether/client/package.json
#nodeDependencies = (callPackage ./node-default.nix { nodejs = nodejs-11_x; }).shell.nodeDependencies;
in
stdenv.mkDerivation rec {
pname = "aether-server";
# server = frontend + backend
# running the frontend (aether-frontend)
# automatically starts the backend (aether-backend-linux-x64)
# the "actual" frontend is called aether-client
version = aether-version;
src = fetchFromGitHub {
owner = aether-owner;
repo = aether-repo;
rev = aether-rev;
sha256 = aether-sha256;
};
dontWrapGApps = true;
buildInputs = [
#electron
electron_11
];
installPhase = ''
mkdir -p $out/bin
cp ${aether-gomodules}/bin/backend $out/bin/aether-backend-linux-x64 # used by aether-frontend
cp ${aether-gomodules}/bin/frontend $out/bin/aether-frontend
runHook postInstall
'';
meta = with lib; {
description = "Peer-to-peer ephemeral public communities";
homepage = "https://getaether.net/";
downloadPage = "https://getaether.net/download/";
license = licenses.agpl3Only;
maintainers = with maintainers; [ ];
# other platforms could be supported by building from source
platforms = [ "x86_64-linux" ];
};
}