Merge pull request #68507 from peterhoeg/f/mtr

nixos/mtr: support for selecting the package
This commit is contained in:
Maximilian Bosch 2019-09-12 09:34:22 +02:00 committed by GitHub
commit 99b291c73c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 4 deletions

@ -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";
};
};

@ -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 {

@ -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 {};