diff options
author | Peter Hoeg <peter@hoeg.com> | 2019-08-05 17:42:17 +0800 |
---|---|---|
committer | Peter Hoeg <peter@hoeg.com> | 2019-08-05 17:42:17 +0800 |
commit | 968d4643b0380238af6abeac56b794a7f45e7ea7 (patch) | |
tree | 111d53f1cc5f1dff0253fc361e292898d70c047a | |
parent | 49e61479d4a5b7e091f55af9f63ca79ddf9b0227 (diff) |
nixos/mtr: make the package configurable
-rw-r--r-- | nixos/modules/programs/mtr.nix | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/nixos/modules/programs/mtr.nix b/nixos/modules/programs/mtr.nix index 1fdec4c04f682..75b710c1584fc 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"; }; }; |