-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- import third party packages as flake inputs - one overall derivation instead of multiple derivations Signed-off-by: Brian McGee <[email protected]>
- Loading branch information
1 parent
520b125
commit b34d412
Showing
12 changed files
with
204 additions
and
309 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# SPDX-FileCopyrightText: 2023 Technology Innovation Institute (TII) | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{ | ||
perSystem = {self', ...}: { | ||
apps = let | ||
inherit (self'.packages) sbomnix; | ||
in { | ||
# nix run .#repology_cli | ||
repology_cli = { | ||
type = "app"; | ||
program = "${sbomnix}/bin/repology_cli"; | ||
}; | ||
|
||
# nix run .#repology_cve | ||
repology_cve = { | ||
type = "app"; | ||
program = "${sbomnix}/bin/repology_cve"; | ||
}; | ||
|
||
# nix run .#nix_outdated | ||
nix_outdated = { | ||
type = "app"; | ||
program = "${sbomnix}/bin/nix_outdated"; | ||
}; | ||
|
||
# nix run .#nix_outdated | ||
nixgraph = { | ||
type = "app"; | ||
program = "${sbomnix}/bin/nixgraph"; | ||
}; | ||
|
||
# nix run .#vulnxscan | ||
vulnxscan = { | ||
type = "app"; | ||
program = "${sbomnix}/bin/vulnxscan"; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# SPDX-FileCopyrightText: 2023 Technology Innovation Institute (TII) | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{inputs, ...}: { | ||
perSystem = { | ||
pkgs, | ||
lib, | ||
... | ||
}: let | ||
pp = pkgs.python3Packages; | ||
|
||
# We use vulnix from 'https://github.com/henrirosten/vulnix' to get | ||
# vulnix support for runtime-only scan ('-C' command-line option) | ||
# which is currently not available in released version of vulnix. | ||
vulnix = (import inputs.vulnix) { | ||
inherit (inputs) nixpkgs; # required but not used as we provide pkgs | ||
inherit pkgs lib; | ||
}; | ||
|
||
nix-visualize = (import inputs.nix-visualize) {inherit pkgs;}; | ||
|
||
pyrate-limiter = pp.buildPythonPackage rec { | ||
version = "2.10.0"; | ||
pname = "pyrate-limiter"; | ||
format = "pyproject"; | ||
|
||
src = pkgs.fetchFromGitHub { | ||
owner = "vutran1710"; | ||
repo = "PyrateLimiter"; | ||
rev = "v${version}"; | ||
hash = "sha256-CPusPeyTS+QyWiMHsU0ii9ZxPuizsqv0wQy3uicrDw0="; | ||
}; | ||
|
||
propagatedBuildInputs = [ | ||
pp.poetry-core | ||
]; | ||
}; | ||
|
||
requests-ratelimiter = pp.buildPythonPackage rec { | ||
version = "0.4.0"; | ||
pname = "requests-ratelimiter"; | ||
format = "pyproject"; | ||
|
||
src = pkgs.fetchFromGitHub { | ||
owner = "JWCook"; | ||
repo = pname; | ||
rev = "v${version}"; | ||
hash = "sha256-F9bfcwijyyKzlFKBJAC/5ETc4/hZpPhm2Flckku2z6M="; | ||
}; | ||
|
||
propagatedBuildInputs = [pyrate-limiter pp.requests]; | ||
}; | ||
in { | ||
packages = rec { | ||
default = sbomnix; | ||
|
||
sbomnix = pp.buildPythonPackage rec { | ||
pname = "sbomnix"; | ||
version = pkgs.lib.removeSuffix "\n" (builtins.readFile ../VERSION); | ||
format = "setuptools"; | ||
|
||
src = lib.cleanSource ../.; | ||
|
||
propagatedBuildInputs = lib.flatten [ | ||
[ | ||
pyrate-limiter | ||
requests-ratelimiter | ||
] | ||
[pkgs.reuse] | ||
(with pp; [ | ||
beautifulsoup4 | ||
colorlog | ||
graphviz | ||
numpy | ||
packageurl-python | ||
packaging | ||
pandas | ||
requests | ||
requests-cache | ||
tabulate | ||
]) | ||
]; | ||
|
||
pythonImportsCheck = ["sbomnix"]; | ||
|
||
postInstall = '' | ||
wrapProgram $out/bin/sbomnix \ | ||
--prefix PATH : ${lib.makeBinPath [pkgs.nix pkgs.graphviz]} | ||
wrapProgram $out/bin/nixgraph \ | ||
--prefix PATH : ${lib.makeBinPath [pkgs.nix pkgs.graphviz]} | ||
wrapProgram $out/bin/nix_outdated \ | ||
--prefix PATH : ${lib.makeBinPath [nix-visualize]} | ||
wrapProgram $out/bin/vulnxscan \ | ||
--prefix PATH : ${lib.makeBinPath [pkgs.grype pkgs.nix vulnix]} | ||
''; | ||
}; | ||
}; | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.