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; [ Br1ght0ne ];
2019-12-30 11:58:58 +00:00
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";
};
};
}