6 # --- Runtime Dependencies ---
19 # `nmcli` is not required for create_ap.
20 # Use NetworkManager by default because it is very likely already present
21 , useNetworkManager ? true
24 # --- WiFi Hotspot Dependencies ---
25 , useWifiDependencies ? true
28 # You only need this if 'iw' can not recognize your adapter.
29 , useWirelessTools ? true
30 , wirelesstools # for iwconfig
31 # To fall back to haveged if entropy is low.
32 # Defaulting to false because not having it does not break things.
33 # If it is really needed, warnings will be logged to journal.
36 # You only need this if you wish to show WiFi QR codes in terminal
41 stdenv.mkDerivation rec {
42 pname = "linux-router";
45 src = fetchFromGitHub {
47 repo = "linux-router";
48 rev = "refs/tags/${version}";
49 hash = "sha256-iIHi434S7+Q9S1EU7Bpa7iYB7MJDTuyMdB/bbTrbl5Q=";
58 installPhase = with lib; let
59 binPath = makeBinPath ([ procps iproute2 getopt bash dnsmasq
60 iptables coreutils which flock gnugrep gnused gawk ]
61 ++ optional useNetworkManager networkmanager
62 ++ optional useWifiDependencies hostapd
63 ++ optional useWifiDependencies iw
64 ++ optional (useWifiDependencies && useWirelessTools) wirelesstools
65 ++ optional (useWifiDependencies && useHaveged) haveged
66 ++ optional (useWifiDependencies && useQrencode) qrencode);
69 mkdir -p $out/bin/ $out/.bin-wrapped
70 mv lnxrouter $out/.bin-wrapped/lnxrouter
71 makeWrapper $out/.bin-wrapped/lnxrouter $out/bin/lnxrouter --prefix PATH : ${binPath}
75 homepage = "https://github.com/garywill/linux-router";
76 description = "Set Linux as router / Wifi hotspot / proxy in one command";
80 - Create a NATed sub-network
84 - IPv6 (behind NATed LAN, like IPv4)
85 - Creating Wifi hotspot:
87 - Choose encryptions: WPA2/WPA, WPA2, WPA, No encryption
88 - Create AP on the same interface you are getting Internet (require same channel)
89 - Transparent proxy (redsocks)
91 - Compatible with NetworkManager (automatically set interface as unmanaged)
93 changelog = "https://github.com/garywill/linux-router/releases/tag/${version}";
94 license = licenses.lgpl21Only;
95 maintainers = with maintainers; [ x3ro ];
96 platforms = platforms.linux;
97 mainProgram = "lnxrouter";