nixpkgs/nixos/modules/programs/liboping.nix
NAHO a2ed7e8d88
nixos: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd \
      --exclude doc/manual/release-notes \
      --type file \
      . \
      nixos \
      --exec-batch sed --in-place --regexp-extended "
        s/\<builtins\.($(
          printf '%s\n' "${builtins[@]}" |
            paste --delimiter '|' --serial -
        ))\>/\1/g
      "

    nix fmt
2026-01-15 16:07:55 +01:00

33 lines
589 B
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.liboping;
in
{
options.programs.liboping = {
enable = lib.mkEnableOption "liboping";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [ liboping ];
security.wrappers = lib.mkMerge (
map
(exec: {
"${exec}" = {
owner = "root";
group = "root";
capabilities = "cap_net_raw+p";
source = "${pkgs.liboping}/bin/${exec}";
};
})
[
"oping"
"noping"
]
);
};
}