diff --git a/nixos/modules/programs/mtr.nix b/nixos/modules/programs/mtr.nix index 1fdec4c04f68..75b710c1584f 100644 --- a/nixos/modules/programs/mtr.nix +++ b/nixos/modules/programs/mtr.nix @@ -4,6 +4,7 @@ with lib; let cfg = config.programs.mtr; + in { options = { programs.mtr = { @@ -15,13 +16,22 @@ in { setcap wrapper for it. ''; }; + + package = mkOption { + type = types.package; + default = pkgs.mtr; + description = '' + The package to use. + ''; + }; }; }; config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [ mtr ]; + environment.systemPackages = with pkgs; [ cfg.package ]; + security.wrappers.mtr-packet = { - source = "${pkgs.mtr}/bin/mtr-packet"; + source = "${cfg.package}/bin/mtr-packet"; capabilities = "cap_net_raw+p"; }; }; diff --git a/pkgs/tools/networking/mtr/default.nix b/pkgs/tools/networking/mtr/default.nix index 1acd513be31f..217f3b7d7cc8 100644 --- a/pkgs/tools/networking/mtr/default.nix +++ b/pkgs/tools/networking/mtr/default.nix @@ -1,11 +1,11 @@ -{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig +{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkgconfig , libcap, ncurses , withGtk ? false, gtk2 ? null }: assert withGtk -> gtk2 != null; stdenv.mkDerivation rec { - pname = "mtr"; + pname = "mtr${lib.optionalString withGtk "-gui"}"; version = "0.93"; src = fetchFromGitHub { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 16469d05491e..cb516caad813 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4860,6 +4860,8 @@ in mtr = callPackage ../tools/networking/mtr {}; + mtr-gui = callPackage ../tools/networking/mtr { withGtk = true; }; + mtx = callPackage ../tools/backup/mtx {}; mt-st = callPackage ../tools/backup/mt-st {};