mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-11 17:50:08 +01:00
61 lines
1.5 KiB
Nix
61 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
cilib,
|
|
...
|
|
}: let
|
|
inherit (lib) mkOption types;
|
|
in {
|
|
soonixSubmodule = {config, ...}: {
|
|
options = {
|
|
componentVersion = mkOption {
|
|
description = "CI/CD component version. Also get's passed to inputs → version";
|
|
type = types.str;
|
|
default = cilib.version;
|
|
};
|
|
componentUrl = mkOption {
|
|
description = "CI/CD component url";
|
|
type = types.str;
|
|
default = "gitlab.com/TECHNOFAB/nix-gitlab-ci/nix-gitlab-ci";
|
|
};
|
|
componentInputs = mkOption {
|
|
description = "Extra inputs to pass to the CI/CD component";
|
|
type = types.attrs;
|
|
default = {};
|
|
};
|
|
extraData = mkOption {
|
|
description = "Extra data to include in the .gitlab-ci.yml file";
|
|
type = types.attrs;
|
|
default = {};
|
|
};
|
|
|
|
finalConfig = mkOption {
|
|
internal = true;
|
|
type = types.attrs;
|
|
};
|
|
};
|
|
config.finalConfig = {
|
|
opts.format = "yaml";
|
|
hook = {
|
|
mode = "copy";
|
|
gitignore = false;
|
|
};
|
|
output = ".gitlab-ci.yml";
|
|
generator = "nix";
|
|
data =
|
|
cilib.helpers.deepMerge
|
|
{
|
|
include = [
|
|
{
|
|
component = "${config.componentUrl}@${config.componentVersion}";
|
|
inputs =
|
|
{
|
|
version = config.componentVersion;
|
|
}
|
|
// config.componentInputs;
|
|
}
|
|
];
|
|
}
|
|
config.extraData;
|
|
};
|
|
};
|
|
}
|