nixos-config/pkgs/gitlab-artifact-cleanup.nix

65 lines
1.5 KiB
Nix

{
lib,
python3Packages,
fetchFromGitHub,
}:
let
yacl = python3Packages.buildPythonPackage rec {
pname = "yacl";
version = "0.6.1";
pyproject = true;
src = fetchFromGitHub {
owner = "IngoMeyer441";
repo = "yacl";
rev = "v${version}";
hash = "sha256-W62amvrH8RdWpBhfmj+iVyekuDhr74ueIOzRw6GO2i8=";
};
build-system = with python3Packages; [ setuptools ];
optional-dependencies = {
colored_exceptions = with python3Packages; [ pygments ];
};
pythonImportsCheck = [ "yacl" ];
meta = {
description = "Yet Another Color Logger for Python programs";
homepage = "https://github.com/IngoMeyer441/yacl";
license = lib.licenses.mit;
};
};
in
python3Packages.buildPythonApplication rec {
pname = "gitlab-artifact-cleanup";
version = "0.1.0";
pyproject = true;
src = fetchFromGitHub {
owner = "sciapp";
repo = "gitlab-artifact-cleanup";
rev = "v${version}";
hash = "sha256-xjJyP1z7bAGjTYxFYByeFbFXu/R8908K8upH5fRZnTs=";
};
build-system = with python3Packages; [ setuptools ];
dependencies =
with python3Packages;
[
python-gitlab
yacl
]
++ yacl.optional-dependencies.colored_exceptions;
pythonImportsCheck = [ "gitlab_artifact_cleanup" ];
meta = {
description = "Tool for cleaning up old GitLab CI/CD job artifacts";
homepage = "https://github.com/sciapp/gitlab-artifact-cleanup";
license = lib.licenses.mit;
mainProgram = "gitlab-artifact-cleanup";
};
}