about summary refs log tree commit diff
path: root/pkgs/tools/networking/wifish
diff options
context:
space:
mode:
authorAndersonTorres <torres.anderson.85@protonmail.com>2021-01-02 22:47:40 -0300
committerAndersonTorres <torres.anderson.85@protonmail.com>2021-01-03 23:16:18 -0300
commit12338f6ca8c14715c5b9cec170cfff4f7ddd30dd (patch)
treef9b7facd35fcff02e29886542d84214af96fb3ee /pkgs/tools/networking/wifish
parent5ccb5d4ca38a5897a5e11e0cfae2bbff5be6911b (diff)
wifish: init at 1.1.4
Diffstat (limited to 'pkgs/tools/networking/wifish')
-rw-r--r--pkgs/tools/networking/wifish/default.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/tools/networking/wifish/default.nix b/pkgs/tools/networking/wifish/default.nix
new file mode 100644
index 0000000000000..f502a2fb0d54c
--- /dev/null
+++ b/pkgs/tools/networking/wifish/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchFromGitHub
+, dialog
+, gawk
+, wpa_supplicant
+, makeWrapper
+}:
+
+stdenv.mkDerivation rec {
+  pname = "wifish";
+  version = "1.1.4";
+
+  src = fetchFromGitHub{
+    owner = "bougyman";
+    repo = "wifish";
+    rev = version;
+    sha256 = "sha256-eTErN6CfKDey/wV+9o9cBVaG5FzCRBiA9UicrMz3KBc=";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  postPatch = ''
+    sed -ie 's|/var/lib/wifish|${placeholder "out"}/var/lib/wifish|' wifish
+  '';
+
+  dontConfigure = true;
+
+  installPhase = ''
+    install -D -m0644 awk/wscanparse.awk ${placeholder "out"}/var/lib/wifish/wscanparse.awk
+    install -D -m0644 awk/wlistparse.awk ${placeholder "out"}/var/lib/wifish/wlistparse.awk
+    install -D -m0644 awk/wscan2menu.awk ${placeholder "out"}/var/lib/wifish/wscan2menu.awk
+    install -D -m0644 awk/iwparse.awk ${placeholder "out"}/var/lib/wifish/iwparse.awk
+    install -D -m0755 wifish ${placeholder "out"}/bin/wifish
+  '';
+
+  postFixup = ''
+    wrapProgram ${placeholder "out"}/bin/wifish \
+      --prefix PATH ":" ${stdenv.lib.makeBinPath [ dialog gawk wpa_supplicant ]}
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/bougyman/wifish";
+    description = "Simple wifi shell script for linux";
+    license = licenses.wtfpl;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = with platforms; linux;
+  };
+}