Platonic-Systems / mission-control

A `flake-parts` module for your Nix devshell scripts
https://community.flake.parts/mission-control
MIT License
72 stars 11 forks source link

Use attrset key instead of package exe #15

Closed srid closed 1 year ago

srid commented 1 year ago

For a config like,

          fmt = {
            exec = pkgs.treefmt;
            category = "Dev Tools";
          };

mission-control generates , treefmt. But we want it to be , fmt instead.

This should also incidentally fix the conflict with an attrset key being the same as one of the shell tools in PATH.

Test in https://github.com/srid/haskell-template/commit/fb9634b22b50f21b196236366c3fdafa967d13c3#diff-206b9ce276ab5971a2489d75eb1b12999d4bf3843b7988cbe8d687cfde61dea0R55

Kranzes commented 1 year ago

Can we use the same type as a flake's apps.X.program for consistency?

srid commented 1 year ago

@Kranzes How would you write the following if exec was of the same type as that of app.X.program (which appears to allow executable path or derivation, but not script)?

https://github.com/Platonic-Systems/mission-control/blob/9acdaa469ebd3c2d6816f8a30c0c217a0da59fe2/example/flake.nix#L17-L20

Kranzes commented 1 year ago

i would use a derivation, writeShellScript or something similar. Also make it buildable by CI.

srid commented 1 year ago

I don't think I want to give up on the convenience syntax of exec = "echo Hello"; for this module.

make it buildable by CI

We have #23 for that.