mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-12 02:00:13 +01:00
docs: improve option descriptions
This commit is contained in:
parent
e7f7043012
commit
cad40720a6
8 changed files with 90 additions and 25 deletions
BIN
docs/images/favicon.png
Normal file
BIN
docs/images/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
BIN
docs/images/logo.png
Normal file
BIN
docs/images/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
|
|
@ -3,14 +3,14 @@ args: let
|
||||||
lib = args.lib or args.pkgs.lib;
|
lib = args.lib or args.pkgs.lib;
|
||||||
# makes it optional to pass if it's not explicitly needed
|
# makes it optional to pass if it's not explicitly needed
|
||||||
pkgs = args.pkgs or (throw "[nix-gitlab-ci] pkgs argument was used but not set, please pass it");
|
pkgs = args.pkgs or (throw "[nix-gitlab-ci] pkgs argument was used but not set, please pass it");
|
||||||
inherit (lib) evalModules;
|
inherit (lib) evalModules trimWith;
|
||||||
|
|
||||||
impl = import ./impl {inherit lib pkgs cilib;};
|
impl = import ./impl {inherit lib pkgs cilib;};
|
||||||
|
|
||||||
cilib = {
|
cilib = {
|
||||||
inherit (impl) helpers modules mkPipeline mkJobRun mkJobDeps mkJobPatched;
|
inherit (impl) helpers modules mkPipeline mkJobRun mkJobDeps mkJobPatched;
|
||||||
utils = import ./utils.nix {inherit pkgs;};
|
utils = import ./utils.nix {inherit pkgs;};
|
||||||
version = builtins.readFile ./VERSION;
|
version = trimWith { start = true; end = true; } (builtins.readFile ./VERSION);
|
||||||
|
|
||||||
mkCI = config:
|
mkCI = config:
|
||||||
(evalModules {
|
(evalModules {
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,16 @@ in rec {
|
||||||
jobConfigSubmodule = {pipelineConfig, ...}: {
|
jobConfigSubmodule = {pipelineConfig, ...}: {
|
||||||
options = {
|
options = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
description = "Transform this job to a nix-configured one";
|
description = ''
|
||||||
|
Transform this job to a nix-configured one.
|
||||||
|
'';
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = pipelineConfig.nixJobsByDefault;
|
default = pipelineConfig.nixJobsByDefault;
|
||||||
};
|
};
|
||||||
deps = mkOption {
|
deps = mkOption {
|
||||||
description = "Dependencies to inject into the job before running it";
|
description = ''
|
||||||
|
Dependencies to inject into the job before running it.
|
||||||
|
'';
|
||||||
type = types.listOf types.package;
|
type = types.listOf types.package;
|
||||||
default = [];
|
default = [];
|
||||||
};
|
};
|
||||||
|
|
@ -23,13 +27,17 @@ in rec {
|
||||||
default = false;
|
default = false;
|
||||||
description = ''
|
description = ''
|
||||||
Cache this job using the GitLab Runner cache.
|
Cache this job using the GitLab Runner cache.
|
||||||
Warning: useful for tiny jobs, but most of the time it just takes an eternity.
|
|
||||||
|
!!! warning
|
||||||
|
useful for tiny jobs, but most of the time it just takes an eternity.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
runnerCacheKey = mkOption {
|
runnerCacheKey = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG";
|
default = "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG";
|
||||||
description = "Cache key to use for the runner nix cache. Requires enableRunnerCache = true";
|
description = ''
|
||||||
|
Cache key to use for the runner nix cache. Requires [`enableRunnerCache = true`](#pipelinesnamejobsnamenixenablerunnercache).
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -46,9 +54,18 @@ in rec {
|
||||||
#
|
#
|
||||||
gitlabOptions = {
|
gitlabOptions = {
|
||||||
stage = mkOption {
|
stage = mkOption {
|
||||||
|
description = ''
|
||||||
|
Pipeline stage to run this job in.
|
||||||
|
'';
|
||||||
type = types.str;
|
type = types.str;
|
||||||
};
|
};
|
||||||
image = mkUnsetOption {
|
image = mkUnsetOption {
|
||||||
|
description = ''
|
||||||
|
Container/OCI image to use for this job.
|
||||||
|
|
||||||
|
!!! warning
|
||||||
|
Setting this will mess with Nix-GitLab-CI, so be careful and only use for non-nix jobs.
|
||||||
|
'';
|
||||||
type = types.str;
|
type = types.str;
|
||||||
};
|
};
|
||||||
variables = mkUnsetOption {
|
variables = mkUnsetOption {
|
||||||
|
|
@ -78,7 +95,9 @@ in rec {
|
||||||
options =
|
options =
|
||||||
{
|
{
|
||||||
nix = mkOption {
|
nix = mkOption {
|
||||||
description = "Nix-GitLab-CI config options for this job";
|
description = ''
|
||||||
|
Nix-GitLab-CI config options for this job.
|
||||||
|
'';
|
||||||
type = types.submoduleWith {
|
type = types.submoduleWith {
|
||||||
modules = [jobConfigSubmodule];
|
modules = [jobConfigSubmodule];
|
||||||
specialArgs.pipelineConfig = pipelineConfig;
|
specialArgs.pipelineConfig = pipelineConfig;
|
||||||
|
|
@ -86,18 +105,34 @@ in rec {
|
||||||
default = {};
|
default = {};
|
||||||
};
|
};
|
||||||
finalConfig = mkOption {
|
finalConfig = mkOption {
|
||||||
|
description = ''
|
||||||
|
Final configuration of this job. (readonly)
|
||||||
|
'';
|
||||||
|
readOnly = true;
|
||||||
internal = true;
|
internal = true;
|
||||||
type = types.attrs;
|
type = types.attrs;
|
||||||
};
|
};
|
||||||
depsDrv = mkOption {
|
depsDrv = mkOption {
|
||||||
|
description = ''
|
||||||
|
Derivation containing all the dependencies of this job. (readonly)
|
||||||
|
'';
|
||||||
|
readOnly = true;
|
||||||
internal = true;
|
internal = true;
|
||||||
type = types.package;
|
type = types.package;
|
||||||
};
|
};
|
||||||
runnerDrv = mkOption {
|
runnerDrv = mkOption {
|
||||||
|
description = ''
|
||||||
|
Derivation containing the script for running the job locally. (readonly)
|
||||||
|
'';
|
||||||
|
readOnly = true;
|
||||||
internal = true;
|
internal = true;
|
||||||
type = types.package;
|
type = types.package;
|
||||||
};
|
};
|
||||||
packages = mkOption {
|
packages = mkOption {
|
||||||
|
description = ''
|
||||||
|
Final packages for this job, eg. for running the job or getting it's deps. (readonly)
|
||||||
|
'';
|
||||||
|
readOnly = true;
|
||||||
internal = true;
|
internal = true;
|
||||||
type = types.attrsOf types.package;
|
type = types.attrsOf types.package;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,9 @@
|
||||||
options =
|
options =
|
||||||
{
|
{
|
||||||
nix = mkOption {
|
nix = mkOption {
|
||||||
description = "Nix-CI config options for this pipeline";
|
description = ''
|
||||||
|
Nix-GitLab-CI config options for this pipeline.
|
||||||
|
'';
|
||||||
type = types.submoduleWith {
|
type = types.submoduleWith {
|
||||||
modules = [pipelineConfigSubmodule];
|
modules = [pipelineConfigSubmodule];
|
||||||
specialArgs.rootConfig = rootConfig;
|
specialArgs.rootConfig = rootConfig;
|
||||||
|
|
@ -54,18 +56,24 @@
|
||||||
default = {};
|
default = {};
|
||||||
};
|
};
|
||||||
finalConfig = mkOption {
|
finalConfig = mkOption {
|
||||||
description = "Final config of the pipeline";
|
description = ''
|
||||||
internal = true;
|
Final config of the pipeline. (readonly)
|
||||||
|
'';
|
||||||
|
readOnly = true;
|
||||||
type = types.attrs;
|
type = types.attrs;
|
||||||
};
|
};
|
||||||
packages = mkOption {
|
packages = mkOption {
|
||||||
description = "Final packages for use in CI";
|
description = ''
|
||||||
internal = true;
|
Final packages for use in CI. (readonly)
|
||||||
|
'';
|
||||||
|
readOnly = true;
|
||||||
type = types.attrsOf types.package;
|
type = types.attrsOf types.package;
|
||||||
};
|
};
|
||||||
# jobs are nested to make distinguishing them from other keys in the ci config easier
|
# jobs are nested to make distinguishing them from other keys in the ci config easier
|
||||||
jobs = mkOption {
|
jobs = mkOption {
|
||||||
description = "Jobs for this pipeline";
|
description = ''
|
||||||
|
Jobs for this pipeline.
|
||||||
|
'';
|
||||||
type = types.attrsOf (types.submoduleWith {
|
type = types.attrsOf (types.submoduleWith {
|
||||||
modules = [jobSubmodule];
|
modules = [jobSubmodule];
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,17 @@ in rec {
|
||||||
configSubmodule = {
|
configSubmodule = {
|
||||||
options = {
|
options = {
|
||||||
soonix = mkOption {
|
soonix = mkOption {
|
||||||
description = "Configure the soonix '.gitlab-ci.yml' generation";
|
description = ''
|
||||||
|
Configure the soonix `.gitlab-ci.yml` generation.
|
||||||
|
'';
|
||||||
type = types.submodule soonixSubmodule;
|
type = types.submodule soonixSubmodule;
|
||||||
default = {};
|
default = {};
|
||||||
};
|
};
|
||||||
nixJobsByDefault = mkOption {
|
nixJobsByDefault = mkOption {
|
||||||
description = ''
|
description = ''
|
||||||
Whether to transform all jobs to nix-configured jobs by default.
|
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.
|
If false, you need to set [`nix.enable`](#pipelinesnamejobsnamenixenable)
|
||||||
|
for each job you want to be transformed.
|
||||||
'';
|
'';
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
|
|
@ -27,12 +30,16 @@ in rec {
|
||||||
nixCiSubmodule = {config, ...}: {
|
nixCiSubmodule = {config, ...}: {
|
||||||
options = {
|
options = {
|
||||||
config = mkOption {
|
config = mkOption {
|
||||||
description = "Configuration of Nix-GitLab-CI itself";
|
description = ''
|
||||||
|
Configuration of Nix-GitLab-CI itself.
|
||||||
|
'';
|
||||||
type = types.submodule configSubmodule;
|
type = types.submodule configSubmodule;
|
||||||
default = {};
|
default = {};
|
||||||
};
|
};
|
||||||
pipelines = mkOption {
|
pipelines = mkOption {
|
||||||
description = "Defines all pipelines";
|
description = ''
|
||||||
|
Defines all pipelines.
|
||||||
|
'';
|
||||||
type = types.attrsOf (types.submoduleWith {
|
type = types.attrsOf (types.submoduleWith {
|
||||||
modules = [pipelineSubmodule];
|
modules = [pipelineSubmodule];
|
||||||
specialArgs.rootConfig = config.config;
|
specialArgs.rootConfig = config.config;
|
||||||
|
|
@ -41,13 +48,19 @@ in rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
packages = mkOption {
|
packages = mkOption {
|
||||||
description = "Final packages for use in CI";
|
description = ''
|
||||||
internal = true;
|
Final packages for use in CI. (readonly)
|
||||||
|
'';
|
||||||
|
readOnly = true;
|
||||||
type = types.attrsOf types.package;
|
type = types.attrsOf types.package;
|
||||||
};
|
};
|
||||||
soonix = mkOption {
|
soonix = mkOption {
|
||||||
description = "Soonix config for .gitlab-ci.yml";
|
description = ''
|
||||||
internal = true;
|
Soonix config for generating `.gitlab-ci.yml`. (readonly)
|
||||||
|
|
||||||
|
See [`config.soonix`](#configsoonix) for configuring this.
|
||||||
|
'';
|
||||||
|
readOnly = true;
|
||||||
type = types.attrs;
|
type = types.attrs;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -8,22 +8,30 @@ in {
|
||||||
soonixSubmodule = {config, ...}: {
|
soonixSubmodule = {config, ...}: {
|
||||||
options = {
|
options = {
|
||||||
componentVersion = mkOption {
|
componentVersion = mkOption {
|
||||||
description = "CI/CD component version. Also get's passed to inputs → version";
|
description = ''
|
||||||
|
CI/CD component version. Also get's passed to inputs → version.
|
||||||
|
'';
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = cilib.version;
|
default = cilib.version;
|
||||||
};
|
};
|
||||||
componentUrl = mkOption {
|
componentUrl = mkOption {
|
||||||
description = "CI/CD component url";
|
description = ''
|
||||||
|
CI/CD component url.
|
||||||
|
'';
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "gitlab.com/TECHNOFAB/nix-gitlab-ci/nix-gitlab-ci";
|
default = "gitlab.com/TECHNOFAB/nix-gitlab-ci/nix-gitlab-ci";
|
||||||
};
|
};
|
||||||
componentInputs = mkOption {
|
componentInputs = mkOption {
|
||||||
description = "Extra inputs to pass to the CI/CD component";
|
description = ''
|
||||||
|
Extra inputs to pass to the CI/CD component.
|
||||||
|
'';
|
||||||
type = types.attrs;
|
type = types.attrs;
|
||||||
default = {};
|
default = {};
|
||||||
};
|
};
|
||||||
extraData = mkOption {
|
extraData = mkOption {
|
||||||
description = "Extra data to include in the .gitlab-ci.yml file";
|
description = ''
|
||||||
|
Extra data to include in the `.gitlab-ci.yml` file.
|
||||||
|
'';
|
||||||
type = types.attrs;
|
type = types.attrs;
|
||||||
default = {};
|
default = {};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ in
|
||||||
"pymdownx.superfences"
|
"pymdownx.superfences"
|
||||||
"pymdownx.escapeall"
|
"pymdownx.escapeall"
|
||||||
"fenced_code"
|
"fenced_code"
|
||||||
|
"admonition"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue