8 , linkOpenssl ? true, openssl
9 , withCap ? true, libcap
10 , withCollectd ? false, collectd
11 , withJson ? false, json_c
12 , withLdap ? true, openldap
13 , withMemcached ? false, libmemcached
14 , withMysql ? false, libmysqlclient
15 , withPcap ? true, libpcap
16 , withRedis ? false, hiredis
17 , withRest ? false, curl
18 , withSqlite ? true, sqlite
19 , withYubikey ? false, libyubikey
22 assert withRest -> withJson;
24 stdenv.mkDerivation rec {
28 src = fetchFromGitHub {
30 repo = "freeradius-server";
31 rev = "refs/tags/release_${lib.replaceStrings [ "." ] [ "_" ] version}";
32 hash = "sha256-1n447BpTqmkg5tyXe9yPzjfDoh7wMLZhwouUEzkwxKM=";
35 nativeBuildInputs = [ autoreconfHook ];
37 buildInputs = [ openssl talloc bsd-finger perl ]
38 ++ lib.optional withCap libcap
39 ++ lib.optional withCollectd collectd
40 ++ lib.optional withJson json_c
41 ++ lib.optional withLdap openldap
42 ++ lib.optional withMemcached libmemcached
43 ++ lib.optional withMysql libmysqlclient
44 ++ lib.optional withPcap libpcap
45 ++ lib.optional withRedis hiredis
46 ++ lib.optional withRest curl
47 ++ lib.optional withSqlite sqlite
48 ++ lib.optional withYubikey libyubikey;
52 "--localstatedir=/var"
53 ] ++ lib.optional (!linkOpenssl) "--with-openssl=no";
56 substituteInPlace src/main/checkrad.in \
57 --replace "/usr/bin/finger" "${bsd-finger}/bin/finger"
60 # By default, freeradius will generate Diffie-Hellman parameters and
61 # self-signed TLS certificates during installation. We don't want
62 # this, for several reasons:
63 # - reproducibility (random generation)
64 # - we don't want _anybody_ to use a cert where the private key is on our public binary cache!
65 # - we don't want the certs to change each time the package is rebuilt
66 # So let's avoid anything getting into our output.
67 makeFlags = [ "LOCAL_CERT_FILES=" ];
70 "sysconfdir=\${out}/etc"
71 "localstatedir=\${TMPDIR}"
72 "INSTALL_CERT_FILES=" # see comment at makeFlags
75 outputs = [ "out" "dev" "man" "doc" ];
78 homepage = "https://freeradius.org/";
79 description = "Modular, high performance free RADIUS suite";
80 license = licenses.gpl2Plus;
81 maintainers = with maintainers; [ sheenobu willibutz ];
82 platforms = with platforms; linux;
85 ## TODO: include windbind optionally (via samba?)
86 ## TODO: include oracle optionally
87 ## TODO: include ykclient optionally