This repository was archived by the owner on Feb 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsdk.nix
156 lines (140 loc) · 4.52 KB
/
sdk.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# SDK is meant to be a bridge between software packages and apps.
#
# `sdk` attribute replaces all uses of `pkgs` within App modules.
# This makes the interface between the two entities thin enough to be able to
# replace any component of it at any point in time or evaluate environment
# configuration without relying on nixpkgs at all.
#
# Values returned by these functions are exported as the `sdk` attribute
# in arguments of every Apps' function.
rec {
#
# Use only this attribute. The rest is "exported" for debugging convenience.
#
sdk = fns // exports // { inherit sdk-env phpPackages perlPackages; };
sdk-env = pkgs.buildEnv {
name = "sdk";
paths = lib.filter lib.isDerivation (lib.attrValues (exports // { inherit phpPackages; }));
ignoreCollisions = true;
};
nixpkgs-config = {
allowUnfree = true;
php = {
apxs2 = false; # apache support
ldap = false; # openldap
mssql = false; # freetds
bz2 = false; pdo_pgsql = false; postgresql = false;
sqlite = false; xsl = false;
bcmath = true; curl = true; exif = true; fpm = true;
ftp = true; gd = true; gettext = true; intl = true;
libxml2 = true; mbstring = true; mcrypt = true; mhash = true;
mysql = true; mysqli = true; openssl = true; pcntl = true;
pdo_mysql = true; readline = true; soap = true; sockets = true;
zip = true; zlib = true;
};
packageOverrides = pkgs: rec {
inherit (ugpkgs) bundler_HEAD erlang imagemagick linux nix;
mysql = ugpkgs.mariadb;
php = ugpkgs.php70;
git = pkgs.git.override {
withManual = false;
pythonSupport = false;
};
go = pkgs.go_1_5;
glibcLocales = pkgs.glibcLocales.override {
allLocales = false;
locales = ["en_US.UTF-8/UTF-8"];
};
gnupg = pkgs.gnupg.override {
pinentry = null;
x11Support = false; openldap = null; libusb = null;
};
python27 = pkgs.python27.override {
x11Support = false;
};
python3 = pkgs.python3.override {
libX11 = null;
tk = null; tcl = null;
};
python34 = pkgs.python34.override {
libX11 = null;
tk = null; tcl = null;
};
qemu = pkgs.qemu.override {
pulseSupport = false;
sdlSupport = false;
spiceSupport = false;
};
};
};
pkgs = import <nixpkgs> {
system = "x86_64-linux";
config = nixpkgs-config;
};
module = {
system.activationScripts.microgram-sdk-env = lib.stringAfter ["nix" "systemd"] ''
${sdk.nix}/bin/nix-env -p /nix/var/nix/profiles/sdk --set ${sdk-env}
'';
nixpkgs.config = nixpkgs-config;
};
ugpkgs = import <microgram/pkgs>;
inherit (pkgs) lib;
# sdk function exports (things that have arguments)
fns = {
# functions that do not produce derivations
inherit (builtins) toFile;
inherit (lib) makeSearchPath;
# functions that do produce derivations
inherit (pkgs)
symlinkJoin
runCommand writeScriptBin writeScript
substituteAll buildEnv writeText writeTextDir writeTextFile;
inherit (ugpkgs.fns)
compileHaskell
staticHaskellCallPackage
writeBashScript
writeBashScriptBin
writeBashScriptBinOverride
writeBashScriptOverride;
};
exports = pkgs // rec {
solr4 = pkgs.solr;
inherit (ugpkgs)
angel
ares
clj-json curator curl-loader
damemtop dynomite
elasticsearch-cloud-aws elastisch erlang
exim
filebeat flame-graph
galera-wsrep get-user-data gdb-quiet graphviz
heavy-sync
jackson-core-asl jenkins jmaps
kibana4 kiries
logstash-all-plugins lua-json
mariadb mariadb-galera memcached-tool mergex mkebs myrapi
newrelic-memcached-plugin newrelic-mysql-plugin newrelic-plugin-agent newrelic-sysmond nginx nix nq
packer percona-toolkit pivotal_agent
rabbitmq rabbitmq-clusterer replicator retry rootfs-busybox runc
ShellCheck simp_le sproxy stack syslog-ng
terraform thumbor to-json-array twemproxy
unicron
upcast
upcast-ng
vault
xd
ybc;
inherit (ugpkgs)
newrelic-java; # is a file
inherit (pkgs.haskellPackages) ghc cabal-install;
cabal = cabal-install;
};
phpPackages = {
inherit (pkgs.phpPackages.override { php = ugpkgs.php70; })
composer redis;
inherit (ugpkgs) imagick memcached newrelic-php xdebug zmq lz4;
};
perlPackages = {
inherit (pkgs.perlPackages) NetAddrIP;
};
}