Skip to content

gitlab-ci: use nix-evaluate-jobs for pipeline generation

Nicolas Froger requested to merge ci-nix-eval-jobs into master

The goal of this merge request is to stop using nix-diff to determine if a derivation needs to be built by the CI. This introduces a few breaking changes as we now require image derivations to be strictly the same after a new unrelated commit, so this removes nixpie from NIX_PATH and makes the Flake registry use the git remote of this repository instead of bundling it in the store. The NixOS label containing Nix PIE's version is also handled differently now: by default Nix PIE's version is now "pregit" (like upstream NixOS) and can be overridden with the NIXPIE_LABEL_VERSION environment variable. This allows us to avoid rebuilding sddm theme configuration each time we commit to this repo for example.

This should fix the annoying rebuild of images unrelated to changes being made in the repo because of the old hard-coded nix-diff allowed line length which was not an ideal solution in the first place.

To match Hydra's behavior, I added the gitlabCiJobs output to the flake which works exactly like hydraJobs. The CI uses nix-evaluate-jobs to evaluate Nix derivations and check if they are in the cache. If not, a build job is triggered in the downstream pipeline.

Edited by Nicolas Froger

Merge request reports