nixpkgs/pkgs/by-name/lo/log4j-scan/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

47 lines
1023 B
Nix

{
lib,
fetchFromGitHub,
python3,
}:
python3.pkgs.buildPythonApplication rec {
pname = "log4j-scan";
version = "unstable-2021-12-18";
format = "other";
src = fetchFromGitHub {
owner = "fullhunt";
repo = pname;
rev = "070fbd00f0945645bd5e0daa199a554ef3884b95";
sha256 = "sha256-ORSc4KHyAMjuA7QHReDh6SYY5yZRunBBN1+lkCayqL4=";
};
propagatedBuildInputs = with python3.pkgs; [
pycryptodome
requests
termcolor
];
postPatch = ''
substituteInPlace log4j-scan.py \
--replace "headers.txt" "../share/headers.txt"
'';
installPhase = ''
runHook preInstall
install -vD ${pname}.py $out/bin/${pname}
install -vD headers.txt headers-large.txt -t $out/share
runHook postInstall
'';
meta = with lib; {
description = "Scanner for finding hosts which are vulnerable for log4j";
mainProgram = "log4j-scan";
homepage = "https://github.com/fullhunt/log4j-scan";
license = licenses.mit;
maintainers = with maintainers; [ fab ];
};
}