diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:47 +0000 |
commit | 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch) | |
tree | b3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/servers/freeradius/default.nix | |
parent | 4e31070265257dc67d120c27e0f75c2344fdfa9a (diff) | |
parent | abf060725d7614bd3b9f96764262dfbc2f9c2199 (diff) | |
download | nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2 nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip |
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/servers/freeradius/default.nix')
-rw-r--r-- | nixpkgs/pkgs/servers/freeradius/default.nix | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/freeradius/default.nix b/nixpkgs/pkgs/servers/freeradius/default.nix new file mode 100644 index 000000000000..df2130777bb8 --- /dev/null +++ b/nixpkgs/pkgs/servers/freeradius/default.nix @@ -0,0 +1,94 @@ +{ stdenv, fetchurl, autoreconfHook, talloc, finger_bsd, perl +, openssl +, linkOpenssl? true +, openldap +, withLdap ? true +, sqlite +, withSqlite ? true +, libpcap +, withPcap ? true +, libcap +, withCap ? true +, libmemcached +, withMemcached ? false +, hiredis +, withRedis ? false +, mysql +, withMysql ? false +, json_c +, withJson ? false +, libyubikey +, withYubikey ? false +, collectd +, withCollectd ? false +, curl +, withRest ? false +}: + +assert withSqlite -> sqlite != null; +assert withLdap -> openldap != null; +assert withPcap -> libpcap != null; +assert withCap -> libcap != null; +assert withMemcached -> libmemcached != null; +assert withRedis -> hiredis != null; +assert withMysql -> mysql != null; +assert withYubikey -> libyubikey != null; +assert withCollectd -> collectd != null; +assert withRest -> curl != null && withJson; + +## TODO: include windbind optionally (via samba?) +## TODO: include oracle optionally +## TODO: include ykclient optionally + +with stdenv.lib; +stdenv.mkDerivation rec { + name = "freeradius-${version}"; + version = "3.0.17"; + + src = fetchurl { + url = "ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-${version}.tar.gz"; + sha256 = "0bc35knv46z729l4h22rirqns5v6jb0fzcffnjayhs8wjysfkfyy"; + }; + + nativeBuildInputs = [ autoreconfHook ]; + + buildInputs = [ openssl talloc finger_bsd perl ] + ++ optional withLdap openldap + ++ optional withSqlite sqlite + ++ optional withPcap libpcap + ++ optional withCap libcap + ++ optional withMemcached libmemcached + ++ optional withRedis hiredis + ++ optional withMysql mysql.connector-c + ++ optional withJson json_c + ++ optional withYubikey libyubikey + ++ optional withCollectd collectd + ++ optional withRest curl; + + + configureFlags = [ + "--sysconfdir=/etc" + "--localstatedir=/var" + ] ++ optional (!linkOpenssl) "--with-openssl=no"; + + postPatch = '' + substituteInPlace src/main/checkrad.in --replace "/usr/bin/finger" "${finger_bsd}/bin/finger" + ''; + + installFlags = [ + "sysconfdir=\${out}/etc" + "localstatedir=\${TMPDIR}" + ]; + + outputs = [ "out" "dev" "man" "doc" ]; + + meta = with stdenv.lib; { + homepage = https://freeradius.org/; + description = "A modular, high performance free RADIUS suite"; + license = licenses.gpl2; + maintainers = with maintainers; [ sheenobu willibutz ]; + platforms = with platforms; linux; + }; + +} + |