1{
2 lib,
3 stdenv,
4 fetchurl,
5 pkg-config,
6 autoreconfHook,
7 libestr,
8 json_c,
9 zlib,
10 docutils,
11 fastJson,
12 withKrb5 ? true,
13 libkrb5,
14 withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
15 systemd,
16 withJemalloc ? true,
17 jemalloc,
18 withMysql ? true,
19 libmysqlclient,
20 withPostgres ? true,
21 libpq,
22 withDbi ? true,
23 libdbi,
24 withNetSnmp ? true,
25 net-snmp,
26 withUuid ? true,
27 libuuid,
28 withCurl ? true,
29 curl,
30 withGnutls ? true,
31 gnutls,
32 withGcrypt ? true,
33 libgcrypt,
34 withLognorm ? true,
35 liblognorm,
36 withMaxminddb ? true,
37 libmaxminddb,
38 withOpenssl ? true,
39 openssl,
40 withRelp ? true,
41 librelp,
42 withKsi ? true,
43 libksi,
44 withLogging ? true,
45 liblogging,
46 withNet ? true,
47 libnet,
48 withHadoop ? true,
49 hadoop,
50 withRdkafka ? true,
51 rdkafka,
52 withMongo ? true,
53 mongoc,
54 withCzmq ? true,
55 czmq,
56 withRabbitmq ? true,
57 rabbitmq-c,
58 withHiredis ? true,
59 hiredis,
60 nixosTests,
61}:
62
63stdenv.mkDerivation rec {
64 pname = "rsyslog";
65 version = "8.2506.0";
66
67 src = fetchurl {
68 url = "https://www.rsyslog.com/files/download/rsyslog/${pname}-${version}.tar.gz";
69 hash = "sha256-bW/QJXyV51Z2XU1YWoM9VN06Dl7rgwi4YqgbNop0u3s=";
70 };
71
72 nativeBuildInputs = [
73 pkg-config
74 autoreconfHook
75 docutils
76 ];
77
78 buildInputs = [
79 fastJson
80 libestr
81 json_c
82 zlib
83 ]
84 ++ lib.optional withKrb5 libkrb5
85 ++ lib.optional withJemalloc jemalloc
86 ++ lib.optional withPostgres libpq
87 ++ lib.optional withDbi libdbi
88 ++ lib.optional withNetSnmp net-snmp
89 ++ lib.optional withUuid libuuid
90 ++ lib.optional withCurl curl
91 ++ lib.optional withGnutls gnutls
92 ++ lib.optional withGcrypt libgcrypt
93 ++ lib.optional withLognorm liblognorm
94 ++ lib.optional withOpenssl openssl
95 ++ lib.optional withRelp librelp
96 ++ lib.optional withKsi libksi
97 ++ lib.optional withLogging liblogging
98 ++ lib.optional withNet libnet
99 ++ lib.optional withHadoop hadoop
100 ++ lib.optional withRdkafka rdkafka
101 ++ lib.optionals withMongo [ mongoc ]
102 ++ lib.optional withCzmq czmq
103 ++ lib.optional withRabbitmq rabbitmq-c
104 ++ lib.optional withHiredis hiredis
105 ++ lib.optional withMaxminddb libmaxminddb
106 ++ lib.optional withMysql libmysqlclient
107 ++ lib.optional withSystemd systemd;
108
109 configureFlags = [
110 "--sysconfdir=/etc"
111 "--localstatedir=/var"
112 "--with-systemdsystemunitdir=\${out}/etc/systemd/system"
113 (lib.enableFeature true "largefile")
114 (lib.enableFeature true "regexp")
115 (lib.enableFeature withKrb5 "gssapi-krb5")
116 (lib.enableFeature true "klog")
117 (lib.enableFeature true "kmsg")
118 (lib.enableFeature withSystemd "imjournal")
119 (lib.enableFeature true "inet")
120 (lib.enableFeature withJemalloc "jemalloc")
121 (lib.enableFeature true "unlimited-select")
122 (lib.enableFeature withCurl "clickhouse")
123 (lib.enableFeature false "debug")
124 (lib.enableFeature false "debug-symbols")
125 (lib.enableFeature true "debugless")
126 (lib.enableFeature false "valgrind")
127 (lib.enableFeature false "diagtools")
128 (lib.enableFeature withCurl "fmhttp")
129 (lib.enableFeature true "usertools")
130 (lib.enableFeature withMysql "mysql")
131 (lib.enableFeature withPostgres "pgsql")
132 (lib.enableFeature withDbi "libdbi")
133 (lib.enableFeature withNetSnmp "snmp")
134 (lib.enableFeature withUuid "uuid")
135 (lib.enableFeature withCurl "elasticsearch")
136 (lib.enableFeature withGnutls "gnutls")
137 (lib.enableFeature withGcrypt "libgcrypt")
138 (lib.enableFeature true "rsyslogrt")
139 (lib.enableFeature true "rsyslogd")
140 (lib.enableFeature true "mail")
141 (lib.enableFeature withLognorm "mmnormalize")
142 (lib.enableFeature withMaxminddb "mmdblookup")
143 (lib.enableFeature true "mmjsonparse")
144 (lib.enableFeature true "mmaudit")
145 (lib.enableFeature true "mmanon")
146 (lib.enableFeature true "mmutf8fix")
147 (lib.enableFeature true "mmcount")
148 (lib.enableFeature true "mmsequence")
149 (lib.enableFeature true "mmfields")
150 (lib.enableFeature true "mmpstrucdata")
151 (lib.enableFeature withOpenssl "mmrfc5424addhmac")
152 (lib.enableFeature withRelp "relp")
153 (lib.enableFeature withKsi "ksi-ls12")
154 (lib.enableFeature withLogging "liblogging-stdlog")
155 (lib.enableFeature withLogging "rfc3195")
156 (lib.enableFeature true "imfile")
157 (lib.enableFeature false "imsolaris")
158 (lib.enableFeature true "imptcp")
159 (lib.enableFeature true "impstats")
160 (lib.enableFeature true "omprog")
161 (lib.enableFeature withNet "omudpspoof")
162 (lib.enableFeature true "omstdout")
163 (lib.enableFeature withSystemd "omjournal")
164 (lib.enableFeature true "pmlastmsg")
165 (lib.enableFeature true "pmcisconames")
166 (lib.enableFeature true "pmciscoios")
167 (lib.enableFeature true "pmaixforwardedfrom")
168 (lib.enableFeature true "pmsnare")
169 (lib.enableFeature true "omruleset")
170 (lib.enableFeature true "omuxsock")
171 (lib.enableFeature true "mmsnmptrapd")
172 (lib.enableFeature withHadoop "omhdfs")
173 (lib.enableFeature withRdkafka "omkafka")
174 (lib.enableFeature withMongo "ommongodb")
175 (lib.enableFeature withCzmq "imczmq")
176 (lib.enableFeature withCzmq "omczmq")
177 (lib.enableFeature withRabbitmq "omrabbitmq")
178 (lib.enableFeature withHiredis "omhiredis")
179 (lib.enableFeature withCurl "omhttp")
180 (lib.enableFeature true "generate-man-pages")
181 ];
182
183 passthru.tests = {
184 nixos-rsyslogd = nixosTests.rsyslogd;
185 };
186
187 meta = {
188 homepage = "https://www.rsyslog.com/";
189 description = "Enhanced syslog implementation";
190 mainProgram = "rsyslogd";
191 changelog = "https://raw.githubusercontent.com/rsyslog/rsyslog/v${version}/ChangeLog";
192 license = lib.licenses.gpl3Only;
193 platforms = lib.platforms.linux;
194 maintainers = [ ];
195 };
196}