2022-07-14 12:49:19 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, darwin, python3 }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2022-10-06 18:32:54 +00:00
|
|
|
version = "1.4.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "iproute2mac";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "brona";
|
|
|
|
repo = "iproute2mac";
|
|
|
|
rev = "v${version}";
|
2022-10-06 18:32:54 +00:00
|
|
|
sha256 = "sha256-MaL8eb9UOZ71BL4Jvc6Od+EJ+F6j96n9a+vRnHeveIU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
buildInputs = [ python3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/ip.py \
|
|
|
|
--replace /sbin/ifconfig ${darwin.network_cmds}/bin/ifconfig \
|
|
|
|
--replace /sbin/route ${darwin.network_cmds}/bin/route \
|
|
|
|
--replace /usr/sbin/netstat ${darwin.network_cmds}/bin/netstat \
|
|
|
|
--replace /usr/sbin/ndp ${darwin.network_cmds}/bin/ndp \
|
|
|
|
--replace /usr/sbin/arp ${darwin.network_cmds}/bin/arp \
|
|
|
|
--replace /usr/sbin/networksetup ${darwin.network_cmds}/bin/networksetup
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
install -D -m 755 src/ip.py $out/bin/ip
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/brona/iproute2mac";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "CLI wrapper for basic network utilites on Mac OS X inspired with iproute2 on Linux systems - ip command";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2022-07-14 12:49:19 +00:00
|
|
|
maintainers = with maintainers; [ jiegec ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.darwin;
|
|
|
|
};
|
|
|
|
}
|