diff options
author | Emily Trau <13267947+emilytrau@users.noreply.github.com> | 2023-11-29 18:24:33 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-29 18:24:33 +1100 |
commit | a557bce7387b84a413eaa666e688325e099d3f01 (patch) | |
tree | 293102290ca4d0f3d7ef8a018de505bdfb3842a8 /nixos/modules | |
parent | d7df51811cac4c88a6ec0a179d3e21e30a8d9722 (diff) | |
parent | 4e6fc83b980ebd91d7cb3b24e5a2927f1d158520 (diff) |
Merge pull request #270344 from hexclover/bump-mininet
mininet: 2.3.0 -> 2.3.1b4, make `mn` start again
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/programs/mininet.nix | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/nixos/modules/programs/mininet.nix b/nixos/modules/programs/mininet.nix index 02272729d233c..01ffd811e70e2 100644 --- a/nixos/modules/programs/mininet.nix +++ b/nixos/modules/programs/mininet.nix @@ -5,26 +5,39 @@ with lib; let - cfg = config.programs.mininet; + cfg = config.programs.mininet; - generatedPath = with pkgs; makeSearchPath "bin" [ - iperf ethtool iproute2 socat + telnet = pkgs.runCommand "inetutils-telnet" + { } + '' + mkdir -p $out/bin + ln -s ${pkgs.inetutils}/bin/telnet $out/bin + ''; + + generatedPath = with pkgs; makeSearchPath "bin" [ + iperf + ethtool + iproute2 + socat + # mn errors out without a telnet binary + # pkgs.inetutils brings an undesired ifconfig into PATH see #43105 + nettools + telnet ]; - pyEnv = pkgs.python.withPackages(ps: [ ps.mininet-python ]); + pyEnv = pkgs.python3.withPackages (ps: [ ps.mininet-python ]); mnexecWrapped = pkgs.runCommand "mnexec-wrapper" - { nativeBuildInputs = [ pkgs.makeWrapper pkgs.pythonPackages.wrapPython ]; } + { nativeBuildInputs = [ pkgs.makeWrapper pkgs.python3Packages.wrapPython ]; } '' makeWrapper ${pkgs.mininet}/bin/mnexec \ $out/bin/mnexec \ --prefix PATH : "${generatedPath}" - ln -s ${pyEnv}/bin/mn $out/bin/mn - - # mn errors out without a telnet binary - # pkgs.inetutils brings an undesired ifconfig into PATH see #43105 - ln -s ${pkgs.inetutils}/bin/telnet $out/bin/telnet + makeWrapper ${pyEnv}/bin/mn \ + $out/bin/mn \ + --prefix PYTHONPATH : "${pyEnv}/${pyEnv.sitePackages}" \ + --prefix PATH : "${generatedPath}" ''; in { |