Skip to content

Commit 928654b

Browse files
domenkozarclaude
andcommitted
fix(tasks): use optionalString instead of mkIf for env.DEVENV_TASKS
mkIf on a freeform submodule attribute registers the key but leaves no value when the condition is false, causing "was accessed but has no value defined" during derivation evaluation. optionalString returns "" instead, which is always a valid value. Fixes #2532 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent dc7dd58 commit 928654b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/modules/tasks.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ in
381381
# Only set DEVENV_TASKS env var for flakes integration or pre-2.0 CLI,
382382
# where devenv-tasks is invoked via shell hooks and needs the env var.
383383
# For 2.0+, DEVENV_TASK_FILE is sufficient and avoids bloating the environment.
384-
env.DEVENV_TASKS = lib.mkIf (config.devenv.cli.version == null || lib.versionOlder config.devenv.cli.version "2.0") (builtins.toJSON tasksJSON);
384+
env.DEVENV_TASKS = lib.optionalString (config.devenv.cli.version == null || lib.versionOlder config.devenv.cli.version "2.0") (builtins.toJSON tasksJSON);
385385
env.DEVENV_TASK_FILE = config.task.config;
386386
task.config = (pkgs.formats.json { }).generate "tasks.json" tasksJSON;
387387

0 commit comments

Comments
 (0)