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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Add direnv (#44)" #50

Closed
wants to merge 1 commit into from
Closed

Conversation

amtoine
Copy link
Member

@amtoine amtoine commented Sep 28, 2023

related to

Important
should be superseded by a PR from @IogaMaster soon (see this comment)

Description of changes

this PR reverts #44.

without any justification for this, i'd rather revert the changes 馃構

@IogaMaster
Copy link
Contributor

Direnv allows automatic environment setup, not just for nix. I did notice you had a setup script, this could run that script automatically on entering the project directory.

@amtoine
Copy link
Member Author

amtoine commented Sep 29, 2023

so direnv would run the content of .envrc automatically, right?

but then what would use flake do?
is that Nushell code?
do you need to be on NixOS to have all this working?

@IogaMaster
Copy link
Contributor

use flake is a hook that is part of nix-direnv. It automatticaly runs nix develop and a does a few things to integrate the devshell into the env. We could wrap that with a check that would see if you have nix installed.

@IogaMaster
Copy link
Contributor

IogaMaster commented Sep 29, 2023

do you need to be on NixOS to have all this working?

Just have nix installed and flakes enabled.

@IogaMaster
Copy link
Contributor

IogaMaster commented Sep 29, 2023

is that Nushell code?

No its regular shell code. I think we could #!/usr/bin/env nu to make it run nushell code.

@AucaCoyan
Copy link
Contributor

AucaCoyan commented Sep 30, 2023

Direnv allows automatic environment setup, not just for nix

Correct, but bear in mind that direnv works on *sh shells, and we kinda are in a new shell project
From the direnv homepage

It supports hooks for all the common shells like bash, zsh, tcsh and fish
source

Is it possible to transcode .envrc to nushell compatible? so we all have the benefit.
It feels awkward to have personal config files (like .vscode or .idea folders), and even more if some OSes are cut out

The other possible approach would be put in an if that checks if you're on Nix?

@IogaMaster
Copy link
Contributor

IogaMaster commented Sep 30, 2023

The other possible approach would be put in an if that checks if you're on Nix?

That was what I was planning after the splitting of lib and bin

@amtoine
Copy link
Member Author

amtoine commented Oct 1, 2023

That was what I was planning after the splitting of lib and bin

that's great and sounds like the best compromise

  • adding support for nix direnv
  • don't break other folks using direnv but not nix

馃憣

i'll leave that PR open for now, just as a reminder to update the .envrc script 馃槈
and i'll go ahead and update the PR description to mention that!

amtoine pushed a commit that referenced this pull request Oct 2, 2023
## Description of changes

<!-- What changes did you make -->
Direnv now checks if you have nix installed before trying to load the
env.
It also checks if you are using nushell and will use the toolkit

## Relevant Issues
- should supersede #50
@amtoine
Copy link
Member Author

amtoine commented Oct 2, 2023

#54 did land and will supersede this PR 馃憤

@amtoine amtoine closed this Oct 2, 2023
@amtoine amtoine deleted the revert-44 branch October 2, 2023 17:29
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.

None yet

3 participants