mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2026-06-19 00:29:25 +02:00
fix: pipelines can have either trigger or script
They canno thave both, so here I add assertions support and use them to avoid this case.
This commit is contained in:
parent
097f775cff
commit
70dc878112
8 changed files with 107 additions and 19 deletions
|
|
@ -2,9 +2,10 @@
|
|||
lib,
|
||||
soonixSubmodule,
|
||||
pipelineSubmodule,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkOption types foldr;
|
||||
inherit (lib) mkOption types foldr mapAttrsToList concatLists;
|
||||
in rec {
|
||||
configSubmodule = {
|
||||
options = {
|
||||
|
|
@ -28,6 +29,7 @@ in rec {
|
|||
};
|
||||
|
||||
nixCiSubmodule = {config, ...}: {
|
||||
imports = [(pkgs.path + /nixos/modules/misc/assertions.nix)];
|
||||
options = {
|
||||
config = mkOption {
|
||||
description = ''
|
||||
|
|
@ -65,6 +67,10 @@ in rec {
|
|||
};
|
||||
};
|
||||
config = {
|
||||
# Propagate pipeline assertions to the root level
|
||||
assertions = concatLists (
|
||||
mapAttrsToList (_name: pipeline: pipeline.assertions) config.pipelines
|
||||
);
|
||||
packages = foldr (pipeline: acc: acc // pipeline) {} (
|
||||
map (pipeline: pipeline.packages) (builtins.attrValues config.pipelines)
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue