Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
56 lines
1.6 KiB
Nix
56 lines
1.6 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
darwin,
|
|
makeWrapper,
|
|
python3,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "iproute2mac";
|
|
version = "1.6.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "brona";
|
|
repo = "iproute2mac";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-aemeZnZlnmIKdLz5Myjn51dYTvfovFPQeytJbNxbI4E=";
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ python3 ];
|
|
|
|
postPatch = ''
|
|
substituteInPlace src/iproute2mac.py \
|
|
--replace-fail /sbin/ifconfig ${darwin.network_cmds}/bin/ifconfig \
|
|
--replace-fail /sbin/route ${darwin.network_cmds}/bin/route \
|
|
--replace-fail /usr/sbin/netstat ${darwin.network_cmds}/bin/netstat \
|
|
--replace-fail /usr/sbin/ndp ${darwin.network_cmds}/bin/ndp \
|
|
--replace-fail /usr/sbin/arp ${darwin.network_cmds}/bin/arp \
|
|
--replace-fail /usr/sbin/networksetup ${darwin.network_cmds}/bin/networksetup
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/bin $out/libexec
|
|
install -D -m 755 src/iproute2mac.py $out/libexec/iproute2mac.py
|
|
install -D -m 755 src/ip.py $out/libexec/ip
|
|
install -D -m 755 src/bridge.py $out/libexec/bridge
|
|
makeWrapper $out/libexec/ip $out/bin/ip
|
|
makeWrapper $out/libexec/bridge $out/bin/bridge
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = {
|
|
homepage = "https://github.com/brona/iproute2mac";
|
|
description = "CLI wrapper for basic network utilites on Mac OS X inspired with iproute2 on Linux systems - ip command";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ jiegec ];
|
|
platforms = lib.platforms.darwin;
|
|
};
|
|
})
|