Generating jobs for `packages` outputs causes infinite recursion
I'm trying to switch to nix-gitlab-ci, but I'm having troubles as this causes nix to error out do to infinite recursion issues. The main problem is that adding a job to ci.jobs causes two new attrs in the packages set.
I've experimented with lib.fix, but at last my nix/FP knowledge fails me here. The only solution that I currently see is to modify nix-gitlab-ci to not had outputs to the packages attrset. :/ This may be related to https://github.com/hercules-ci/flake-parts/issues/176
Sample:
{
perSystem =
{ lib, config, system, ... }:
let
removeCiJobs = lib.filterAttrs (name: _: !lib.hasPrefix "gitlab-ci-job" name);
in
{
ci.jobs = lib.mapAttrs' (name: _: {
name = "packages:${name}";
value = {
script = [ "nix build -L --no-link .#packages.${system}.${name}" ];
};
}) (removeCiJobs config.packages);
};
}