nixos/mtr: make the package configurable
This commit is contained in:
parent
49e61479d4
commit
968d4643b0
@ -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";
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user