Merge pull request #135026 from ckiee/cnping
This commit is contained in:
commit
6f0ff67bb0
@ -129,6 +129,7 @@
|
||||
./programs/cdemu.nix
|
||||
./programs/chromium.nix
|
||||
./programs/clickshare.nix
|
||||
./programs/cnping.nix
|
||||
./programs/command-not-found/command-not-found.nix
|
||||
./programs/criu.nix
|
||||
./programs/dconf.nix
|
||||
|
21
nixos/modules/programs/cnping.nix
Normal file
21
nixos/modules/programs/cnping.nix
Normal file
@ -0,0 +1,21 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.programs.cnping;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
programs.cnping = {
|
||||
enable = mkEnableOption "Whether to install a setcap wrapper for cnping";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
security.wrappers.cnping = {
|
||||
source = "${pkgs.cnping}/bin/cnping";
|
||||
capabilities = "cap_net_raw+ep";
|
||||
};
|
||||
};
|
||||
}
|
32
pkgs/tools/networking/cnping/default.nix
Normal file
32
pkgs/tools/networking/cnping/default.nix
Normal file
@ -0,0 +1,32 @@
|
||||
{ lib, stdenv, fetchFromGitHub, libglvnd, xorg }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "cnping";
|
||||
version = "unstable-2021-04-04";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "cntools";
|
||||
repo = "cnping";
|
||||
rev = "6b89363e6b79ecbf612306d42a8ef94a5a2f756a";
|
||||
sha256 = "sha256-E3Wm5or6C4bHq7YoyaEbtDwyd+tDVYUOMeQrprlmL4A=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
buildInputs = [ libglvnd xorg.libXinerama xorg.libXext xorg.libX11 ];
|
||||
|
||||
# The "linuxinstall" target won't work for us:
|
||||
# it tries to setcap and copy to a FHS directory
|
||||
installPhase = ''
|
||||
mkdir -p $out/{bin,share/man/man1}
|
||||
cp cnping $out/bin/cnping
|
||||
cp cnping.1 $out/share/man/man1/cnping.1
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Minimal Graphical IPV4 Ping Tool";
|
||||
homepage = "https://github.com/cntools/cnping";
|
||||
license = with licenses; [ mit bsd3 ]; # dual licensed, MIT-x11 & BSD-3-Clause
|
||||
maintainers = with maintainers; [ ckie ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
@ -8711,6 +8711,8 @@ with pkgs;
|
||||
|
||||
cntlm = callPackage ../tools/networking/cntlm { };
|
||||
|
||||
cnping = callPackage ../tools/networking/cnping { };
|
||||
|
||||
past-time = python3Packages.callPackage ../tools/misc/past-time { };
|
||||
|
||||
pastebinit = callPackage ../tools/misc/pastebinit { };
|
||||
|
Loading…
Reference in New Issue
Block a user