2019-12-30 12:58:58 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
2019-12-31 09:17:28 +01:00
|
|
|
let cfg = config.programs.bandwhich;
|
2019-12-30 12:58:58 +01:00
|
|
|
in {
|
|
|
|
meta.maintainers = with maintainers; [ filalex77 ];
|
|
|
|
|
|
|
|
options = {
|
2019-12-31 09:17:28 +01:00
|
|
|
programs.bandwhich = {
|
2019-12-30 12:58:58 +01:00
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = ''
|
2019-12-31 09:17:28 +01:00
|
|
|
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 {
|
2019-12-31 09:17:28 +01:00
|
|
|
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";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|