mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 14:26:33 +01:00
30 lines
631 B
Nix
30 lines
631 B
Nix
|
{ config, lib, pkgs, ... }:
|
||
|
|
||
|
with lib;
|
||
|
|
||
|
let cfg = config.programs.what;
|
||
|
in {
|
||
|
meta.maintainers = with maintainers; [ filalex77 ];
|
||
|
|
||
|
options = {
|
||
|
programs.what = {
|
||
|
enable = mkOption {
|
||
|
type = types.bool;
|
||
|
default = false;
|
||
|
description = ''
|
||
|
Whether to add what to the global environment and configure a
|
||
|
setcap wrapper for it.
|
||
|
'';
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
|
||
|
config = mkIf cfg.enable {
|
||
|
environment.systemPackages = with pkgs; [ what ];
|
||
|
security.wrappers.what = {
|
||
|
source = "${pkgs.what}/bin/what";
|
||
|
capabilities = "cap_net_raw,cap_net_admin+ep";
|
||
|
};
|
||
|
};
|
||
|
}
|