diff options
author | hexclover <47456195+hexclover@users.noreply.github.com> | 2023-12-07 15:19:00 +0800 |
---|---|---|
committer | Matthieu Coudron <886074+teto@users.noreply.github.com> | 2023-12-22 19:15:14 +0100 |
commit | 66bda599f409f9834c6fd6abc602e452a5c16b61 (patch) | |
tree | 914a7eafeb56f074a6012ce0059f34a68273eaa0 /nixos/modules/programs/mininet.nix | |
parent | ea8bb2df93b9b8db2619328e690da962eaf99862 (diff) |
mininet, nixos/mininet: Wrap executables in the package, not the module
Also move the `mn` executable from the Python module to the main package.
Diffstat (limited to 'nixos/modules/programs/mininet.nix')
-rw-r--r-- | nixos/modules/programs/mininet.nix | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/nixos/modules/programs/mininet.nix b/nixos/modules/programs/mininet.nix index 01ffd811e70e..3568736854d8 100644 --- a/nixos/modules/programs/mininet.nix +++ b/nixos/modules/programs/mininet.nix @@ -6,39 +6,6 @@ with lib; let cfg = config.programs.mininet; - - 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.python3.withPackages (ps: [ ps.mininet-python ]); - - mnexecWrapped = pkgs.runCommand "mnexec-wrapper" - { nativeBuildInputs = [ pkgs.makeWrapper pkgs.python3Packages.wrapPython ]; } - '' - makeWrapper ${pkgs.mininet}/bin/mnexec \ - $out/bin/mnexec \ - --prefix PATH : "${generatedPath}" - - makeWrapper ${pyEnv}/bin/mn \ - $out/bin/mn \ - --prefix PYTHONPATH : "${pyEnv}/${pyEnv.sitePackages}" \ - --prefix PATH : "${generatedPath}" - ''; in { options.programs.mininet.enable = mkEnableOption (lib.mdDoc "Mininet"); @@ -47,6 +14,6 @@ in virtualisation.vswitch.enable = true; - environment.systemPackages = [ mnexecWrapped ]; + environment.systemPackages = [ pkgs.mininet ]; }; } |