nixpkgs/nixos/modules/programs/bandwhich.nix

30 lines
666 B
Nix
Raw Normal View History

2019-12-30 12:58:58 +01:00
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.programs.bandwhich;
2019-12-30 12:58:58 +01:00
in {
meta.maintainers = with maintainers; [ filalex77 ];
options = {
programs.bandwhich = {
2019-12-30 12:58:58 +01:00
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to add bandwhich to the global environment and configure a
2019-12-30 12:58:58 +01: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 12:58:58 +01:00
capabilities = "cap_net_raw,cap_net_admin+ep";
};
};
}