Skip to content
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

Don't exit with error when running help #35

Merged
merged 1 commit into from
Jul 28, 2023

Conversation

jackinloadup
Copy link
Contributor

@jackinloadup jackinloadup commented Jul 28, 2023

Changed exit status to success when running help to allow interoperability with direnv

When using direnv mission-control's help would run when moving into the directory. Help would exit with an error and thus direnv would this something went wrong when loading into the environment and back out. This caused direnv to be effectively useless when used in combination with mission-control.

Changed exit status to success when running help to help with interoperability with direnv
@srid
Copy link
Member

srid commented Jul 28, 2023

direnv would this something went wrong when loading into the environment and back out.

What do you mean? Seems to work fine for me on haskell-template:

image

@jackinloadup
Copy link
Contributor Author

@srid Thanks for looking at this and bearing with me.

While documenting this I nailed down the exact reason our experiences are different. It comes down to the following setting config.home-manager.users.lriutzel.programs.direnv.config.global.strict_env = true (internal duh moment). Where as your config nixosConfigurations.actual.config.home-manager.users.srid.programs.direnv.config = {}. This config is referring to direnv.toml. Aside, the ability to reference you config with nixos is quite magical.

Looking at man direnv.toml shows the following:

strict_env
       If set to true, the .envrc will be loaded with set -euo pipefail. This option will be the default in the future.

With the option becoming default "in the future" I hope that is enough motivation and clarity to accept this PR with or without modifications. Either way thanks for listening 😄


Somewhat irrelevant documentation

I thought I figured this out last night but maybe not. Just to tie these two different reports together for another 3rd party I also explored the same issue I'm experiencing here srid/rust-nix-template#21.

Doing the same thing you did above produces the following result:
2023-07-28-121917_grim

I validated that when direnv gave the following error direnv: error exit status 1 it was taking issue the exit of the help menu in mission-control. I validated this today by changing the error code to 42 and got the following result.

2023-07-28-134627_grim

I acknowledge it's working for your setup. There must be something with my environment that is different. I'll try to reduce my environment to see if that gets me some more information.

I'm documenting what I have learned thus far here.

  • I repl'd your nixos config and noticed nixosConfigurations.actual.config.users.users.srid.shell was bash. I changed over to bash and rebooted to ensure the user was completely switched over bash in case a logout/login wasn't enough.
  • Tried without starship prompt.
  • Explore removing more tui customization.
  • Explore using nixos-unstable instead of nixos-23.05.

Apologies if this is noise. Just trying to get this neat tool working for me correctly 😄 . It seems like my shell or direnv is being more strict with the error or something.

Copy link
Member

@srid srid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, great. That's good to know. strict_env should indeed be enabled, IMO. Thanks for the info.

@srid srid merged commit 9d25d9f into Platonic-Systems:master Jul 28, 2023
1 check passed
@srid

This comment was marked as outdated.

@jackinloadup
Copy link
Contributor Author

I think you might be behind origin or something. The , comma command and "Available commands" menu is from mission-control.

I just built HEAD of the repo and it worked... with no default menu displaying.

2023-07-28-172713_grim

I haven't used just anywhere yet so I'm not very familiar. I really enjoy the experience of the menu showing when navigating into a project. Maybe rust-nix-template can add just to the shellHook or w/e to show.

@jackinloadup
Copy link
Contributor Author

Maybe need a nix flake update?

@srid
Copy link
Member

srid commented Jul 28, 2023

Hmm, yea, false alarm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants