nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 133 lines 3.0 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 pkg-config, 6 libnl, 7 openssl, 8 nixosTests, 9 sqlite ? null, 10}: 11 12stdenv.mkDerivation rec { 13 pname = "hostapd"; 14 version = "2.11"; 15 16 src = fetchurl { 17 url = "https://w1.fi/releases/${pname}-${version}.tar.gz"; 18 sha256 = "sha256-Kz+stjL9T2XjL0v4Kna0tyxQH5laT2LjMCGf567RdHo="; 19 }; 20 21 nativeBuildInputs = [ pkg-config ]; 22 buildInputs = [ 23 libnl 24 openssl 25 sqlite 26 ]; 27 28 patches = [ 29 (fetchurl { 30 # Note: fetchurl seems to be unhappy with openwrt git 31 # server's URLs containing semicolons. Using the github mirror instead. 32 url = "https://raw.githubusercontent.com/openwrt/openwrt/eefed841b05c3cd4c65a78b50ce0934d879e6acf/package/network/services/hostapd/patches/300-noscan.patch"; 33 sha256 = "08p5frxhpq1rp2nczkscapwwl8g9nc4fazhjpxic5bcbssc3sb00"; 34 }) 35 ]; 36 37 outputs = [ 38 "out" 39 "man" 40 ]; 41 42 # Based on hostapd's defconfig. Only differences are tracked. 43 extraConfig = '' 44 # Use epoll(7) instead of select(2) on linux 45 CONFIG_ELOOP_EPOLL=y 46 47 # Drivers 48 CONFIG_DRIVER_WIRED=y 49 CONFIG_DRIVER_NONE=y 50 51 # Integrated EAP server 52 CONFIG_EAP_SIM=y 53 CONFIG_EAP_AKA=y 54 CONFIG_EAP_AKA_PRIME=y 55 CONFIG_EAP_PAX=y 56 CONFIG_EAP_PSK=y 57 CONFIG_EAP_PWD=y 58 CONFIG_EAP_SAKE=y 59 CONFIG_EAP_GPSK=y 60 CONFIG_EAP_GPSK_SHA256=y 61 CONFIG_EAP_FAST=y 62 CONFIG_EAP_IKEV2=y 63 CONFIG_EAP_TNC=y 64 CONFIG_EAP_EKE=y 65 66 CONFIG_TLS=openssl 67 CONFIG_TLSV11=y 68 CONFIG_TLSV12=y 69 70 CONFIG_SAE=y 71 CONFIG_SAE_PK=y 72 73 CONFIG_OWE=y 74 CONFIG_OCV=y 75 76 # TKIP is considered insecure and upstream support will be removed in the future 77 CONFIG_NO_TKIP=y 78 79 # Misc 80 CONFIG_RADIUS_SERVER=y 81 CONFIG_MACSEC=y 82 CONFIG_DRIVER_MACSEC_LINUX=y 83 CONFIG_FULL_DYNAMIC_VLAN=y 84 CONFIG_VLAN_NETLINK=y 85 CONFIG_GETRANDOM=y 86 CONFIG_INTERWORKING=y 87 CONFIG_HS20=y 88 CONFIG_FST=y 89 CONFIG_FST_TEST=y 90 CONFIG_ACS=y 91 CONFIG_WNM=y 92 CONFIG_MBO=y 93 94 CONFIG_IEEE80211R=y 95 CONFIG_IEEE80211W=y 96 CONFIG_IEEE80211N=y 97 CONFIG_IEEE80211AC=y 98 CONFIG_IEEE80211AX=y 99 CONFIG_IEEE80211BE=y 100 '' 101 + lib.optionalString (sqlite != null) '' 102 CONFIG_SQLITE=y 103 ''; 104 105 passAsFile = [ "extraConfig" ]; 106 107 configurePhase = '' 108 cd hostapd 109 cp -v defconfig .config 110 cat $extraConfigPath >> .config 111 cat -n .config 112 substituteInPlace Makefile --replace /usr/local $out 113 export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $(pkg-config --cflags libnl-3.0)" 114 ''; 115 116 preInstall = "mkdir -p $out/bin"; 117 postInstall = '' 118 install -vD hostapd.8 -t $man/share/man/man8 119 install -vD hostapd_cli.1 -t $man/share/man/man1 120 ''; 121 122 passthru.tests = { 123 inherit (nixosTests) wpa_supplicant; 124 }; 125 126 meta = with lib; { 127 homepage = "https://w1.fi/hostapd/"; 128 description = "User space daemon for access point and authentication servers"; 129 license = licenses.bsd3; 130 maintainers = with maintainers; [ oddlama ]; 131 platforms = platforms.linux; 132 }; 133}