2022-01-19 23:45:15 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, libnl, openssl, sqlite ? null }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "hostapd";
|
2022-01-19 23:45:15 +00:00
|
|
|
version = "2.10";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://w1.fi/releases/${pname}-${version}.tar.gz";
|
2022-01-19 23:45:15 +00:00
|
|
|
sha256 = "sha256-IG58eZtnhXLC49EgMCOHhLxKn4IyOwFWtMlGbxSYkV0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ libnl openssl sqlite ];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(fetchurl {
|
|
|
|
# Note: fetchurl seems to be unhappy with openwrt git
|
|
|
|
# server's URLs containing semicolons. Using the github mirror instead.
|
2022-01-19 23:45:15 +00:00
|
|
|
url = "https://raw.githubusercontent.com/openwrt/openwrt/eefed841b05c3cd4c65a78b50ce0934d879e6acf/package/network/services/hostapd/patches/300-noscan.patch";
|
|
|
|
sha256 = "08p5frxhpq1rp2nczkscapwwl8g9nc4fazhjpxic5bcbssc3sb00";
|
2021-04-13 19:44:15 +00:00
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# Based on hostapd's defconfig. Only differences are tracked.
|
2020-04-24 23:36:52 +00:00
|
|
|
extraConfig = ''
|
2023-07-15 17:15:38 +00:00
|
|
|
# Use epoll(7) instead of select(2) on linux
|
|
|
|
CONFIG_ELOOP_EPOLL=y
|
|
|
|
|
|
|
|
# Drivers
|
2020-04-24 23:36:52 +00:00
|
|
|
CONFIG_DRIVER_WIRED=y
|
2023-07-15 17:15:38 +00:00
|
|
|
CONFIG_DRIVER_NONE=y
|
|
|
|
|
|
|
|
# Integrated EAP server
|
2020-04-24 23:36:52 +00:00
|
|
|
CONFIG_EAP_SIM=y
|
|
|
|
CONFIG_EAP_AKA=y
|
|
|
|
CONFIG_EAP_AKA_PRIME=y
|
|
|
|
CONFIG_EAP_PAX=y
|
2023-07-15 17:15:38 +00:00
|
|
|
CONFIG_EAP_PSK=y
|
2020-04-24 23:36:52 +00:00
|
|
|
CONFIG_EAP_PWD=y
|
|
|
|
CONFIG_EAP_SAKE=y
|
|
|
|
CONFIG_EAP_GPSK=y
|
|
|
|
CONFIG_EAP_GPSK_SHA256=y
|
|
|
|
CONFIG_EAP_FAST=y
|
|
|
|
CONFIG_EAP_IKEV2=y
|
|
|
|
CONFIG_EAP_TNC=y
|
|
|
|
CONFIG_EAP_EKE=y
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
CONFIG_TLS=openssl
|
|
|
|
CONFIG_TLSV11=y
|
|
|
|
CONFIG_TLSV12=y
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
CONFIG_SAE=y
|
|
|
|
CONFIG_SAE_PK=y
|
|
|
|
|
|
|
|
CONFIG_OWE=y
|
|
|
|
CONFIG_OCV=y
|
|
|
|
|
|
|
|
# TKIP is considered insecure and upstream support will be removed in the future
|
|
|
|
CONFIG_NO_TKIP=y
|
|
|
|
|
|
|
|
# Misc
|
|
|
|
CONFIG_RADIUS_SERVER=y
|
|
|
|
CONFIG_FULL_DYNAMIC_VLAN=y
|
|
|
|
CONFIG_VLAN_NETLINK=y
|
|
|
|
CONFIG_GETRANDOM=y
|
|
|
|
CONFIG_INTERWORKING=y
|
2020-04-24 23:36:52 +00:00
|
|
|
CONFIG_HS20=y
|
2023-07-15 17:15:38 +00:00
|
|
|
CONFIG_FST=y
|
|
|
|
CONFIG_FST_TEST=y
|
2020-04-24 23:36:52 +00:00
|
|
|
CONFIG_ACS=y
|
2023-07-15 17:15:38 +00:00
|
|
|
CONFIG_WNM=y
|
|
|
|
CONFIG_MBO=y
|
|
|
|
|
|
|
|
CONFIG_IEEE80211R=y
|
|
|
|
CONFIG_IEEE80211W=y
|
|
|
|
CONFIG_IEEE80211N=y
|
|
|
|
CONFIG_IEEE80211AC=y
|
|
|
|
CONFIG_IEEE80211AX=y
|
2021-02-05 17:12:51 +00:00
|
|
|
'' + lib.optionalString (sqlite != null) ''
|
2020-04-24 23:36:52 +00:00
|
|
|
CONFIG_SQLITE=y
|
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
passAsFile = [ "extraConfig" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
configurePhase = ''
|
|
|
|
cd hostapd
|
|
|
|
cp -v defconfig .config
|
2023-07-15 17:15:38 +00:00
|
|
|
cat $extraConfigPath >> .config
|
2020-04-24 23:36:52 +00:00
|
|
|
cat -n .config
|
|
|
|
substituteInPlace Makefile --replace /usr/local $out
|
|
|
|
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $(pkg-config --cflags libnl-3.0)"
|
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall = "mkdir -p $out/bin";
|
|
|
|
postInstall = ''
|
|
|
|
install -vD hostapd.8 -t $man/share/man/man8
|
|
|
|
install -vD hostapd_cli.1 -t $man/share/man/man1
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-12-17 10:02:37 +00:00
|
|
|
homepage = "https://w1.fi/hostapd/";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A user space daemon for access point and authentication servers";
|
|
|
|
license = licenses.gpl2;
|
2023-11-16 04:20:00 +00:00
|
|
|
maintainers = with maintainers; [ hexa ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|