mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 07:13:23 +01:00
fedd7cd690
This is slightly more verbose and inconvenient, but it forces you to think about what the wrapper ownership and permissions will be.
24 lines
522 B
Nix
24 lines
522 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.programs.liboping;
|
|
in {
|
|
options.programs.liboping = {
|
|
enable = mkEnableOption "liboping";
|
|
};
|
|
config = mkIf cfg.enable {
|
|
environment.systemPackages = with pkgs; [ liboping ];
|
|
security.wrappers = mkMerge (map (
|
|
exec: {
|
|
"${exec}" = {
|
|
owner = "root";
|
|
group = "root";
|
|
capabilities = "cap_net_raw+p";
|
|
source = "${pkgs.liboping}/bin/${exec}";
|
|
};
|
|
}
|
|
) [ "oping" "noping" ]);
|
|
};
|
|
}
|