mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 03:17:13 +00:00
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
40 lines
1.3 KiB
Nix
40 lines
1.3 KiB
Nix
{ lib, stdenv, fetchurl, libpcap, sqlite, makeWrapper }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
version = "1.4";
|
|
pname = "reaver-wps";
|
|
confdir = "/var/db/${pname}-${version}"; # the sqlite database is at "${confdir}/reaver/reaver.db"
|
|
|
|
src = fetchurl {
|
|
url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/reaver-wps/reaver-${version}.tar.gz";
|
|
sha256 = "0bdjai4p8xbsw8zdkkk43rgsif79x0nyx4djpyv0mzh59850blxd";
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
buildInputs = [ libpcap sqlite ];
|
|
|
|
|
|
setSourceRoot = ''
|
|
sourceRoot=$(echo */src)
|
|
'';
|
|
|
|
configureFlags = [ "--sysconfdir=${confdir}" ];
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/{bin,etc}
|
|
cp reaver.db $out/etc/
|
|
cp reaver wash $out/bin/
|
|
|
|
wrapProgram $out/bin/reaver --run "[ -s ${confdir}/reaver/reaver.db ] || install -D $out/etc/reaver.db ${confdir}/reaver/reaver.db"
|
|
wrapProgram $out/bin/wash --run "[ -s ${confdir}/reaver/reaver.db ] || install -D $out/etc/reaver.db ${confdir}/reaver/reaver.db"
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Brute force attack against Wifi Protected Setup";
|
|
homepage = "https://code.google.com/archive/p/reaver-wps/";
|
|
license = licenses.gpl2Plus;
|
|
platforms = platforms.linux;
|
|
maintainers = with maintainers; [ nico202 volth ];
|
|
};
|
|
}
|