Skip to content

Commit

Permalink
nixos/mtr: make the package configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
peterhoeg committed Aug 5, 2019
1 parent 49e6147 commit 968d464
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions nixos/modules/programs/mtr.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ with lib;

let
cfg = config.programs.mtr;

in {
options = {
programs.mtr = {
Expand All @@ -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";
};
};
Expand Down

0 comments on commit 968d464

Please sign in to comment.