{ lib, soonixSubmodule, pipelineSubmodule, ... }: let inherit (lib) mkOption types; in rec { configSubmodule = { options = { soonix = mkOption { description = "Configure the soonix '.gitlab-ci.yml' generation"; type = types.submodule soonixSubmodule; default = {}; }; nixJobsByDefault = mkOption { description = '' Whether to transform all jobs to nix-configured jobs by default. If false, you need to set `nix.enable` for each job you want to be transformed. ''; type = types.bool; default = true; }; }; }; nixCiSubmodule = {config, ...}: { options = { config = mkOption { description = "Configuration of Nix-GitLab-CI itself"; type = types.submodule configSubmodule; default = {}; }; pipelines = mkOption { description = "Defines all pipelines"; type = types.attrsOf (types.submoduleWith { modules = [pipelineSubmodule]; specialArgs.rootConfig = config.config; }); default = {}; }; packages = mkOption { description = "Final packages for use in CI"; internal = true; type = types.attrsOf types.package; }; soonix = mkOption { description = "Soonix config for .gitlab-ci.yml"; internal = true; type = types.attrs; }; }; config = { packages = lib.fold (pipeline: acc: acc // pipeline) {} ( map (pipeline: pipeline.packages) (builtins.attrValues config.pipelines) ); soonix = config.config.soonix.finalConfig; }; }; }