Open domenkozar opened 1 year ago
I think this feature would completely eliminate the need for a Makefile.
What is the benefit of the subcommand over the already existing script support?
It seems the only difference is whether the script is on the PATH vs. the subcommand is built-in the devenv script.
I think I'd prefer it to be a global config in configuration.nix
or home.nix
.
I'd use it like devenv someplugin someargument
.
E.g.
devenv bettersearch mypackage
Inspiration: gh
.
I do like that something like up
can become a subcommands this way. I also found that a setup
command is often useful, which currently is a script.
I also like that this makes the configuration less dependent on the devenv executable. Being able to run some of these commands without devenv will allow better usage of them when using devenv in a flake.
That said, the distinction between subcommands and scripts is not clear. There probably needs to be docs on when to use one or the other.
@sayanarijit having them configurable globally will make the the environment not reproducible anymore. You'd have to communicate to any users which plugins they need to install/enable.
I've been using this approach successfully for years, using infranix. infranix
is using the same module-based approach as climod
, but it is generating a Makefile behind the scenes while climod
is just generating bash code.
Anyway, I just wanted to say that the "plugin experience" you get from this (especially when you're using the module system directly, I don't know if end users will do that in devenv
) is really nice. I also gave a talk about this at NixCon London 2018.
If you haven't seen just, I recommend you look into it. It is a very nice alternative to Makefiles, and could either be useful behind the scenes in devenv
, or even exposed directly to users.
Also, if you ever find yourself implementing auto completion, compleat is a very useful DSL for it.
It would be interesting if there was a way to extend devenv commands. This would allow for some kind of concept of plugins.
And running it:
Could be used with #103 for cli parsing.