-
Notifications
You must be signed in to change notification settings - Fork 265
Create unified function for nix env computation #591
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
Conversation
return nil | ||
} | ||
|
||
func (d *Devbox) computeNixEnv() ([]string, error) { |
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.
Should this be called in other places we need env? (Shell
and RunScriptInNewNixShell
)
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.
I believe that is the intention (in a future PR)
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.
Correct!
return nil | ||
} | ||
|
||
func (d *Devbox) computeNixEnv() ([]string, error) { |
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.
I believe that is the intention (in a future PR)
internal/impl/devbox.go
Outdated
|
||
func (d *Devbox) computeNixEnv() ([]string, error) { | ||
nixShellFilePath := filepath.Join(d.projectDir, ".devbox/gen/shell.nix") | ||
vaf, err := nix.PrintDevEnv(nixShellFilePath) |
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.
use: d.nixShellFilePath()
but first please approve #584 so it can be landed :)
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.
oops, sorry for not seeing that earlier! merging in main and updating...
Summary
This mainly refactors the env computation from
nix.Run()
into a place where it can be reused for both shell, run, and direnv integration. This should be a functional no-op.How was it tested?
./devbox run -- echo '$PATH'
and other env vars