Merge pull request #68507 from peterhoeg/f/mtr
nixos/mtr: support for selecting the package
This commit is contained in:
commit
99b291c73c
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 {};
|
||||
|
|
Loading…
Reference in a new issue