Skip to content

fix: add default value to gitlab.ci option to prevent error when unset

Bossypants requested to merge fix/gitlab-ci-default-value into master

Summary

Fixes a regression where importing the gitlab-ci flakeModule without setting any gitlab.ci configuration causes evaluation to fail with:

error: The option `perSystem.x86_64-linux.gitlab.ci' was accessed but has no value defined.

Root cause: The options.gitlab.ci option was defined with type = types.submoduleWith { ... } but no default = {}. The config.perSystem block uses with config.gitlab.ci; which eagerly evaluates the option before mkIf enable can short-circuit.

Fix: Add default = {}; so the submodule initialises with internal defaults (enable = false, etc.) even when no consumer explicitly configures it.

Test: Added it-evaluates-without-config — imports the flakeModule without any gitlab.ci settings and verifies evaluation succeeds.

Edited by Daniel Firth

Merge request reports