1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-21 13:44:50 +00:00
nixpkgs/nixos/modules/programs/bandwhich.nix

30 lines
666 B
Nix
Raw Normal View History

2019-12-30 11:58:58 +00:00
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.programs.bandwhich;
2019-12-30 11:58:58 +00:00
in {
meta.maintainers = with maintainers; [ filalex77 ];
options = {
programs.bandwhich = {
2019-12-30 11:58:58 +00:00
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to add bandwhich to the global environment and configure a
2019-12-30 11:58:58 +00:00
setcap wrapper for it.
'';
};
};
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ bandwhich ];
security.wrappers.bandwhich = {
source = "${pkgs.bandwhich}/bin/bandwhich";
2019-12-30 11:58:58 +00:00
capabilities = "cap_net_raw,cap_net_admin+ep";
};
};
}