From 7b32e2db1ee15113af552510495fb2891ff947b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Eug=C3=AAnio?= Date: Tue, 4 Aug 2026 20:40:47 -0300 Subject: [PATCH] gitlab: add gitlab-artifact-cleanup --- pkgs/default.nix | 1 + pkgs/gitlab-artifact-cleanup.nix | 65 ++++++++++++++++++++++++++++++++ user/git.nix | 2 + 3 files changed, 68 insertions(+) create mode 100644 pkgs/gitlab-artifact-cleanup.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 415e419..83f4b1f 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -13,6 +13,7 @@ rec { emmet-cli = pkgs.callPackage ./emmet-cli.nix { }; material-wifi-icons = pkgs.callPackage ./material-wifi-icons.nix { }; gnome-pass-search-provider = pkgs.callPackage ./gnome-pass-search-provider.nix { }; + gitlab-artifact-cleanup = pkgs.callPackage ./gitlab-artifact-cleanup.nix { }; my-factorio-headless = pkgs.callPackage ./factorio-headless { inherit (pkgs.unstable) factorio-headless; }; diff --git a/pkgs/gitlab-artifact-cleanup.nix b/pkgs/gitlab-artifact-cleanup.nix new file mode 100644 index 0000000..3845625 --- /dev/null +++ b/pkgs/gitlab-artifact-cleanup.nix @@ -0,0 +1,65 @@ +{ + 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"; + }; +} diff --git a/user/git.nix b/user/git.nix index 8d10eed..fd50475 100644 --- a/user/git.nix +++ b/user/git.nix @@ -73,6 +73,8 @@ in gh glab + + gitlab-artifact-cleanup ]; }; }