devenv icon indicating copy to clipboard operation
devenv copied to clipboard

Specify packages available to task

Open szlend opened this issue 1 year ago • 2 comments

I'd like to be able to specify a list of packages available to a task.

So instead of:

tasks = {
  "check:taplo-fmt" = {
    exec = "${pkgs.fd}/bin/fd --hidden --extension=toml --exec-batch ${pkgs.taplo}/bin/taplo format --check";
  };
};

You could write something like this:

tasks = {
  "check:taplo-fmt" = {
    packages = [ pkgs.fd pkgs.taplo ];
    exec = "fd --hidden --extension=toml --exec-batch taplo format --check";
  };
};

The packages option might be confusing together with the existing option tasks.<name>.package which could imo be renamed to something like tasks.<name>.entrypoint or tasks.<name>.interpreter.

szlend avatar Oct 15 '24 17:10 szlend

@szlend would you expect those packages to be an addition to top-level packages option?

domenkozar avatar Oct 15 '24 17:10 domenkozar

@szlend would you expect those packages to be an addition to top-level packages option?

I would expect them to be independent to minimize the closure size in CI where tasks would execute. That's how it currently works, right? Or at least make it configurable to disable inheriting from global packages.

szlend avatar Oct 15 '24 18:10 szlend