nixpkgs-suyu/pkgs/os-specific/darwin/iproute2mac/default.nix

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

38 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, darwin, python3 }:
2018-06-09 22:13:01 +02:00
stdenv.mkDerivation rec {
2022-09-19 03:27:43 +02:00
version = "1.4.1";
pname = "iproute2mac";
2018-06-09 22:13:01 +02:00
src = fetchFromGitHub {
owner = "brona";
repo = "iproute2mac";
rev = "v${version}";
2022-09-19 03:27:43 +02:00
sha256 = "sha256-MaL8eb9UOZ71BL4Jvc6Od+EJ+F6j96n9a+vRnHeveIU=";
2018-06-09 22:13:01 +02:00
};
buildInputs = [ python3 ];
2018-06-09 22:13:01 +02:00
postPatch = ''
2018-06-09 23:12:16 +02:00
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
2018-06-09 22:13:01 +02:00
'';
installPhase = ''
mkdir -p $out/bin
install -D -m 755 src/ip.py $out/bin/ip
'';
meta = with lib; {
homepage = "https://github.com/brona/iproute2mac";
2018-06-09 22:13:01 +02:00
description = "CLI wrapper for basic network utilites on Mac OS X inspired with iproute2 on Linux systems - ip command.";
license = licenses.mit;
maintainers = with maintainers; [ jiegec ];
2018-06-09 22:13:01 +02:00
platforms = platforms.darwin;
};
}