ctucx.git: nixfiles

ctucx' nixfiles

commit f5c195675afb30b37bc82e25f678267a304d151b
parent 281903a607c50efdbff9ec778c7c5d45b71999bf
Author: Leah (ctucx) <git@ctu.cx>
Date: Tue, 19 Mar 2024 13:58:16 +0100

pkgs: add `rofi-ied-wifi-menu`
2 files changed, 43 insertions(+), 0 deletions(-)
M
pkgs/overlay.nix
|
1
+
A
pkgs/rofi-iwd-wifi-menu.nix
|
42
++++++++++++++++++++++++++++++++++++++++++
diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix
@@ -21,4 +21,5 @@ final: prev:
   mastoFE-standalone     = final.callPackage ./masto-fe-standalone {};
 
   usbtan-cli             = final.callPackage ./usbtan-cli {};
+  rofi-iwd-wifi-menu     = final.callPackage ./rofi-iwd-wifi-menu.nix {};
 }
diff --git a/pkgs/rofi-iwd-wifi-menu.nix b/pkgs/rofi-iwd-wifi-menu.nix
@@ -0,0 +1,42 @@
+{ stdenv, lib, util-linux, python3, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "rofi-iwd-wifi-menu";
+  version = "0.0.0";
+
+  src = fetchFromGitHub {
+    owner  = "defname";
+    repo   = "rofi-iwd-wifi-menu";
+    rev    = "02c6c319bc5997480e19d05818dd6eba5732dee3";
+    sha256 = "sha256-tNOsQSaTg/Wja3ap6b611esnTC07w6X0ifIVnJL5Ojs=";
+  };
+
+
+  buildInputs = [
+    (python3.withPackages (pythonPackages: with pythonPackages; [
+      pexpect
+    ]))
+  ];
+
+  buildPhase = "true";
+
+  installPhase = ''
+    mkdir -p $out/bin $out/rofi-iwd-wifi-menu
+
+    cp -r $src/iwdrofimenu    $out/rofi-iwd-wifi-menu/
+    cp -r $src/res            $out/rofi-iwd-wifi-menu/
+    cp    $src/iwdrofimenu.py $out/rofi-iwd-wifi-menu/
+    cp    $src/settings.py    $out/rofi-iwd-wifi-menu/
+
+    ln -s $out/rofi-iwd-wifi-menu/iwdrofimenu.py $out/bin/iwdrofimenu
+
+    substituteInPlace $out/rofi-iwd-wifi-menu/settings.py --replace '"rfkill_cmd": "rfkill",' '"rfkill_cmd": "${util-linux}/bin/rfkill",'
+  '';
+
+
+  meta = with lib; {
+    homepage    = "https://github.com/defname/rofi-iwd-wifi-menu";
+    description = "Minimalistic WiFi network chooser for iwd using rofi.";
+    license     = licenses.gpl3Only;
+  };
+}