-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enterShell/script/subcommand phases #209
Comments
I'll think about this one a bit more, since it needs to be carefully crafted. |
The proposed solution is mostly adopted from the mkDerivation phases (unpack, build, configure, install). There it works alright. I'm interested in any other solutions. |
In devshell there is a mechanism to declare dependencies between startup commands. A config which defines {
devshell.startup = {
check = { text = "echo checking stuff..."; };
greet = {
deps = ["check"];
text = "echo hello there!";
};
};
} See the option definition here and here The setup commands (which are bash snippets) are ordered using textClosureMap function from nixpkgs.
I'd be happy to port this to |
I'd say all the included module should define their |
Additionally, we could add an |
Currently I'm running into limitations of scripts and enterShell when extending devenv with modules.
For instance, I'd like to add some 'assertions' to enterShell from a module. Assertions are runtime checks like:
~/.npmrc
have the authorization tokens?~/.m2/settings.xml
refer to the local repository that the project is presuming to use?/etc/hosts
contain the entry that the project presumes?I'd also like to automatically run
bundle
.I also want to show a welcome message explaining some of the standard commands for the project (general setup, db setup, run the application, run the tests).
The order of these actions is important. Assertions must be run first. Welcome message must come last.
When adding these to enterShell it'll be added in the order that the modules are loaded, which is quite error-prone. In addition, when the project devenv.nix defines enterShell, those lines will always come last.
When adding these to a (setup) script using
scripts.setup.exec
it'll not be possible because the type isstr
, which doesn't append automatically likelines
does.I'm thinking of some kind of phases:
which should result in
Is some form of this useful?
Are there others ways of tackling the problem?
The text was updated successfully, but these errors were encountered: