-
Notifications
You must be signed in to change notification settings - Fork 132
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
Add support for Nix build environment #338
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the submission!
As it's an OS-specific feature, I won't enable it by default as it could impact other OSes (see comments).
Check out tests/_pure.test.fist to see how to test your feature settings:
Lines 318 to 328 in 586869b
@test "configure: pure_enable_k8s" ( | |
set --erase pure_enable_k8s | |
source (status dirname)/../conf.d/pure.fish | |
echo $pure_enable_k8s | |
) = false | |
@test "configure: pure_symbol_k8s_prefix" ( | |
set --erase pure_symbol_k8s_prefix | |
source (status dirname)/../conf.d/pure.fish | |
echo $pure_symbol_k8s_prefix | |
) = "☸" |
Then you can have a look at tests/_pure_prompt_k8s.test.fish to see how you can test the feature itself
https://github.com/pure-fish/pure/blob/586869bdf0f336d8fdcc4efd4a169a9f53a10a36/tests/_pure_prompt_k8s.test.fish
When that's done, we will need to restrict executions of the feature's tests in CI to the Nix job only, i.e detecting the OS with uname -s
pure/tests/_pure_is_inside_container.test.fish
Lines 77 to 78 in 586869b
if test (uname -s) = Linux | |
@test "_pure_is_inside_container: detect with pid method" ( |
As I mentioned above, Nix is not only available on NixOS. So IMHO we don't need to restrict CI tests. |
I've introduced another config variable so that one can customize colors of prefix symbol (by |
Because on my system diff --git a/makefile b/makefile
index a4368e5..6822660 100644
--- a/makefile
+++ b/makefile
@@ -1,7 +1,7 @@
#!/usr/bin/make -sf
# force use of Bash
-SHELL := /bin/bash
+SHELL := /usr/bin/env bash
INTERACTIVE=true and then ran tests using docker: make build-pure-on FISH_VERSION=3.6.4
make test-pure-on FISH_VERSION=3.6.4 All tests passed. |
@m15a would you be willing to add a feature where only the icon is shown, but the status text (eg i can also send a separate PR for that once this is merged if @edouard-lopez is okay with the added feature, but having it be in this PR would be easier. |
Could you add the makefile change, it's a more robust approach. I would prefer another PR to keep them small. I would look at this one Thursday, thanks for your patience |
@edouard-lopez Thanks!! |
related: none
A small contribution for Nix users to indicate if
nix develop
shell is activated in their prompt.How to test pre-release?
Then your prompt looks like
First contribution?
Check the 👍 Contribute section and the contributing guide.
Specs
New config in
conf.d/pure.fish
Documentation
Usage
Acceptance Checks
conf.d/pure.fish
;conf.d/pure.fish
;