From 905482f5bfceed317714ad13aefa1a5769a2f311 Mon Sep 17 00:00:00 2001 From: Sander Date: Sun, 23 Feb 2025 02:34:10 +0400 Subject: [PATCH] tasks: fix the bash assertion for tasks that use exports --- src/modules/tasks.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/tasks.nix b/src/modules/tasks.nix index afe75c661..6540c6f18 100644 --- a/src/modules/tasks.nix +++ b/src/modules/tasks.nix @@ -35,7 +35,7 @@ let }; binary = lib.mkOption { type = types.nullOr types.str; - description = "Override the binary name if it differs from from the output of `lib.getExe`."; + description = "Override the binary name from the default `package.meta.mainProgram`."; default = null; }; package = lib.mkOption { @@ -123,8 +123,8 @@ in assertions = [ { - assertion = lib.all (task: lib.hasPrefix "bash" task.binary || task.exports == [ ]) (lib.attrValues config.tasks); - message = "The 'exports' option for a task can only be set when 'binary' is set to 'bash' or 'bash-interactive'."; + assertion = lib.all (task: task.package.meta.mainProgram == "bash" || task.binary == "bash" || task.exports == [ ]) (lib.attrValues config.tasks); + message = "The 'exports' option for a task can only be set when 'package' is a bash package."; } ];