nixpkgs/pkgs/by-name/ha/haka/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

37 lines
1.2 KiB
Nix

{ lib, stdenv, fetchurl, cmake, swig, wireshark, check, rsync, libpcap, gawk, libedit, pcre, nixosTests }:
let version = "0.3.0"; in
stdenv.mkDerivation {
pname = "haka";
inherit version;
src = fetchurl {
name = "haka_${version}_source.tar.gz";
url = "https://github.com/haka-security/haka/releases/download/v${version}/haka_${version}_source.tar.gz";
sha256 = "0dm39g3k77sa70zrjsqadidg27a6iqq61jzfdxazpllnrw4mjy4w";
};
env.NIX_CFLAGS_COMPILE = "-Wno-error";
preConfigure = ''
sed -i 's,/etc,'$out'/etc,' src/haka/haka.c
sed -i 's,/etc,'$out'/etc,' src/haka/CMakeLists.txt
sed -i 's,/opt/haka/etc,$out/opt/haka/etc,' src/haka/haka.1
sed -i 's,/etc,'$out'/etc,' doc/user/tool_suite_haka.rst
'';
nativeBuildInputs = [ cmake ];
buildInputs = [ swig wireshark check rsync libpcap gawk libedit pcre ];
passthru.tests = { inherit (nixosTests) haka; };
meta = {
description = "Collection of tools that allows capturing TCP/IP packets and filtering them based on Lua policy files";
homepage = "http://www.haka-security.org/";
license = lib.licenses.mpl20;
maintainers = [ lib.maintainers.tvestelind ];
platforms = [ "x86_64-linux" "i686-linux" ]; # fails on aarch64
};
}