at 21.11-pre 666 B view raw
1{ config, lib, pkgs, ... }: 2 3with lib; 4 5let cfg = config.programs.bandwhich; 6in { 7 meta.maintainers = with maintainers; [ Br1ght0ne ]; 8 9 options = { 10 programs.bandwhich = { 11 enable = mkOption { 12 type = types.bool; 13 default = false; 14 description = '' 15 Whether to add bandwhich to the global environment and configure a 16 setcap wrapper for it. 17 ''; 18 }; 19 }; 20 }; 21 22 config = mkIf cfg.enable { 23 environment.systemPackages = with pkgs; [ bandwhich ]; 24 security.wrappers.bandwhich = { 25 source = "${pkgs.bandwhich}/bin/bandwhich"; 26 capabilities = "cap_net_raw,cap_net_admin+ep"; 27 }; 28 }; 29}