about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2019-09-12 09:34:22 +0200
committerGitHub <noreply@github.com>2019-09-12 09:34:22 +0200
commit99b291c73c589a1b807bb6c4e7a727d9a994e495 (patch)
treedbfa3a5171854c431eb096dd13dd147b253fcaf7 /nixos/modules
parent4bb69053f19fe6497f963c9ba8a1fb252bdb4537 (diff)
parent968d4643b0380238af6abeac56b794a7f45e7ea7 (diff)
downloadnixlib-99b291c73c589a1b807bb6c4e7a727d9a994e495.tar
nixlib-99b291c73c589a1b807bb6c4e7a727d9a994e495.tar.gz
nixlib-99b291c73c589a1b807bb6c4e7a727d9a994e495.tar.bz2
nixlib-99b291c73c589a1b807bb6c4e7a727d9a994e495.tar.lz
nixlib-99b291c73c589a1b807bb6c4e7a727d9a994e495.tar.xz
nixlib-99b291c73c589a1b807bb6c4e7a727d9a994e495.tar.zst
nixlib-99b291c73c589a1b807bb6c4e7a727d9a994e495.zip
Merge pull request #68507 from peterhoeg/f/mtr
nixos/mtr: support for selecting the package
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/programs/mtr.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/nixos/modules/programs/mtr.nix b/nixos/modules/programs/mtr.nix
index 1fdec4c04f68..75b710c1584f 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";
     };
   };