Skip to content

Commit

Permalink
programs.mtr: init setcap-wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
globin committed Feb 17, 2017
1 parent e67416f commit bd0d8ed
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Expand Up @@ -80,6 +80,7 @@
./programs/light.nix
./programs/man.nix
./programs/mosh.nix
./programs/mtr.nix
./programs/nano.nix
./programs/oblogout.nix
./programs/screen.nix
Expand Down
27 changes: 27 additions & 0 deletions nixos/modules/programs/mtr.nix
@@ -0,0 +1,27 @@
{ config, lib, pkgs, ... }:

with lib;

let
cfg = config.programs.mtr;
in {
options = {
programs.mtr = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to add mtr to the global environment and configure a
setcap wrapper for it.
'';
};
};
};

config = mkIf cfg.enable {
security.wrappers.mtr = {
source = "${pkgs.mtr}/bin/mtr";
capabilities = "cap_net_raw+p";
};
};
}

0 comments on commit bd0d8ed

Please sign in to comment.