Closed amtoine closed 10 months ago
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.
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?
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.
do you need to be on NixOS to have all this working?
Just have nix installed and flakes enabled.
is that Nushell code?
No its regular shell code. I think we could #!/usr/bin/env nu
to make it run nushell code.
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
?
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
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
:ok_hand:
i'll leave that PR open for now, just as a reminder to update the .envrc
script :wink:
and i'll go ahead and update the PR description to mention that!
https://github.com/nushell/nufmt/pull/54 did land and will supersede this PR :+1:
related to
44
Description of changes
this PR reverts #44.
without any justification for this, i'd rather revert the changes :yum: