1 # Global configuration for mininet
2 # kernel must have NETNS/VETH/SCHED
3 { config, lib, pkgs, ... }:
8 cfg = config.programs.mininet;
10 generatedPath = with pkgs; makeSearchPath "bin" [
11 iperf ethtool iproute2 socat
14 pyEnv = pkgs.python.withPackages(ps: [ ps.mininet-python ]);
16 mnexecWrapped = pkgs.runCommand "mnexec-wrapper"
17 { nativeBuildInputs = [ pkgs.makeWrapper pkgs.pythonPackages.wrapPython ]; }
19 makeWrapper ${pkgs.mininet}/bin/mnexec \
21 --prefix PATH : "${generatedPath}"
23 ln -s ${pyEnv}/bin/mn $out/bin/mn
25 # mn errors out without a telnet binary
26 # pkgs.inetutils brings an undesired ifconfig into PATH see #43105
27 ln -s ${pkgs.inetutils}/bin/telnet $out/bin/telnet
31 options.programs.mininet.enable = mkEnableOption (lib.mdDoc "Mininet");
33 config = mkIf cfg.enable {
35 virtualisation.vswitch.enable = true;
37 environment.systemPackages = [ mnexecWrapped ];