git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/mtr: make the package configurable
commit968d4643b0380238af6abeac56b794a7f45e7ea7 authorPeter Hoeg <peter@hoeg.com> dateMon 5 Aug 2019, 17:42 (7 years ago) parent49e6147
1 file changed+12−2
nixos/modules/programs/mtr.nix+12−2
nixos/modules/programs/mtr.nix+12−2
@@ -4,6 +4,7 @@ with lib;
44
55let
66 cfg = config.programs.mtr;
7+
78in {
89 options = {
910 programs.mtr = {
@@ -15,13 +16,22 @@ in {
1516 setcap wrapper for it.
1617 '';
1718 };
19+
20+ package = mkOption {
21+ type = types.package;
22+ default = pkgs.mtr;
23+ description = ''
24+ The package to use.
25+ '';
26+ };
1827 };
1928 };
2029
2130 config = mkIf cfg.enable {
22− environment.systemPackages = with pkgs; [ mtr ];
31+ environment.systemPackages = with pkgs; [ cfg.package ];
32+
2333 security.wrappers.mtr-packet = {
24− source = "${pkgs.mtr}/bin/mtr-packet";
34+ source = "${cfg.package}/bin/mtr-packet";
2535 capabilities = "cap_net_raw+p";
2636 };
2737 };