nixpkgs/pkgs/by-name/vu/vulnix/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

66 lines
1.3 KiB
Nix

{ lib
, python3Packages
, fetchFromGitHub
, nix
, ronn
}:
python3Packages.buildPythonApplication rec {
pname = "vulnix";
version = "1.10.1-unstable-2024-04-02";
src = fetchFromGitHub {
owner = "nix-community";
repo = "vulnix";
rev = "ebd8ea84553c0fd95bc3042584b495560821500f";
hash = "sha256-huC520cLPjcmnbh+qOamyVfiIJNrCUpwK+orEp+X2LQ=";
};
postPatch = ''
substituteInPlace setup.cfg \
--replace "--flake8" ""
'';
outputs = [ "out" "doc" "man" ];
nativeBuildInputs = [ ronn ];
nativeCheckInputs = with python3Packages; [
freezegun
pytest
pytest-cov
];
propagatedBuildInputs = [
nix
] ++ (with python3Packages; [
click
colorama
pyyaml
requests
setuptools
toml
zodb
]);
postBuild = "make -C doc";
checkPhase = "py.test src/vulnix";
postInstall = ''
install -D -t $doc/share/doc/vulnix README.rst CHANGES.rst
gzip $doc/share/doc/vulnix/*.rst
install -D -t $man/share/man/man1 doc/vulnix.1
install -D -t $man/share/man/man5 doc/vulnix-whitelist.5
'';
dontStrip = true;
meta = with lib; {
description = "NixOS vulnerability scanner";
mainProgram = "vulnix";
homepage = "https://github.com/nix-community/vulnix";
license = licenses.bsd3;
maintainers = with maintainers; [ ckauhaus ];
};
}