docs: improve option descriptions

This commit is contained in:
technofab 2025-09-02 11:12:29 +02:00
parent e7f7043012
commit cad40720a6
No known key found for this signature in database
8 changed files with 90 additions and 25 deletions

View file

@ -9,12 +9,16 @@ in rec {
jobConfigSubmodule = {pipelineConfig, ...}: {
options = {
enable = mkOption {
description = "Transform this job to a nix-configured one";
description = ''
Transform this job to a nix-configured one.
'';
type = types.bool;
default = pipelineConfig.nixJobsByDefault;
};
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;
default = [];
};
@ -23,13 +27,17 @@ in rec {
default = false;
description = ''
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 {
type = types.str;
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 = {
stage = mkOption {
description = ''
Pipeline stage to run this job in.
'';
type = types.str;
};
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;
};
variables = mkUnsetOption {
@ -78,7 +95,9 @@ in rec {
options =
{
nix = mkOption {
description = "Nix-GitLab-CI config options for this job";
description = ''
Nix-GitLab-CI config options for this job.
'';
type = types.submoduleWith {
modules = [jobConfigSubmodule];
specialArgs.pipelineConfig = pipelineConfig;
@ -86,18 +105,34 @@ in rec {
default = {};
};
finalConfig = mkOption {
description = ''
Final configuration of this job. (readonly)
'';
readOnly = true;
internal = true;
type = types.attrs;
};
depsDrv = mkOption {
description = ''
Derivation containing all the dependencies of this job. (readonly)
'';
readOnly = true;
internal = true;
type = types.package;
};
runnerDrv = mkOption {
description = ''
Derivation containing the script for running the job locally. (readonly)
'';
readOnly = true;
internal = true;
type = types.package;
};
packages = mkOption {
description = ''
Final packages for this job, eg. for running the job or getting it's deps. (readonly)
'';
readOnly = true;
internal = true;
type = types.attrsOf types.package;
};