nixpkgs/pkgs/os-specific/linux/linux-wifi-hotspot/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

80 lines
1.6 KiB
Nix
Raw Normal View History

2021-09-07 09:01:11 +00:00
{ lib
, stdenv
, fetchFromGitHub
, which
, pkg-config
, glib
, gtk3
, iw
, makeWrapper
, qrencode
2022-04-13 17:20:37 +00:00
, hostapd
, getopt
, dnsmasq
, iproute2
, flock
, iptables
, gawk }:
2021-09-07 09:01:11 +00:00
stdenv.mkDerivation rec {
pname = "linux-wifi-hotspot";
version = "4.4.0";
src = fetchFromGitHub {
owner = "lakinduakash";
repo = pname;
rev = "v${version}";
sha256 = "sha256-XCgYWOX7QSdANG6DqYk0yZZqnvZGDl3GaF9KtYRmpJ0=";
};
nativeBuildInputs = [
which
pkg-config
makeWrapper
qrencode
hostapd
];
buildInputs = [
glib
gtk3
];
outputs = [ "out" ];
postPatch = ''
substituteInPlace ./src/scripts/Makefile \
--replace "etc" "$out/etc"
substituteInPlace ./src/scripts/wihotspot \
--replace "/usr" "$out"
'';
makeFlags = [
"PREFIX=${placeholder "out"}"
];
postInstall = ''
wrapProgram $out/bin/create_ap \
2022-04-13 17:20:37 +00:00
--prefix PATH : ${lib.makeBinPath [
hostapd getopt iw which dnsmasq iproute2 flock iptables gawk
]}
2021-09-07 09:01:11 +00:00
wrapProgram $out/bin/wihotspot-gui \
--prefix PATH : ${lib.makeBinPath [ iw ]} \
--prefix PATH : "${placeholder "out"}/bin"
wrapProgram $out/bin/wihotspot \
--prefix PATH : ${lib.makeBinPath [ iw ]} \
--prefix PATH : "${placeholder "out"}/bin"
'';
meta = with lib; {
description = "Feature-rich wifi hotspot creator for Linux which provides both GUI and command-line interface";
homepage = "https://github.com/lakinduakash/linux-wifi-hotspot";
license = licenses.bsd2;
maintainers = with maintainers; [ onny ];
platforms = platforms.unix;
};
}