mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-12 02:00:13 +01:00
feat: initial v3 rewrite
This commit is contained in:
commit
0952ab4145
32 changed files with 1457 additions and 0 deletions
61
lib/impl/modules/soonix.nix
Normal file
61
lib/impl/modules/soonix.nix
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue