Skip to content

[minor cleanup] use flake dir instead of flake-file-path in nix print-dev-env #1538

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

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/impl/devbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ func (d *Devbox) computeNixEnv(ctx context.Context, usePrintDevEnvCache bool) (m
maps.Copy(originalEnv, env)

vaf, err := d.nix.PrintDevEnv(ctx, &nix.PrintDevEnvArgs{
FlakesFilePath: d.nixFlakesFilePath(),
FlakeDir: d.flakeDir(),
PrintDevEnvCachePath: d.nixPrintDevEnvCachePath(),
UsePrintDevEnvCache: usePrintDevEnvCache,
})
Expand Down Expand Up @@ -928,8 +928,8 @@ func (d *Devbox) nixPrintDevEnvCachePath() string {
return filepath.Join(d.projectDir, ".devbox/.nix-print-dev-env-cache")
}

func (d *Devbox) nixFlakesFilePath() string {
return filepath.Join(d.projectDir, ".devbox/gen/flake/flake.nix")
func (d *Devbox) flakeDir() string {
return filepath.Join(d.projectDir, ".devbox/gen/flake")
}

// ConfigPackageNames returns the package names as defined in devbox.json
Expand Down
4 changes: 2 additions & 2 deletions internal/nix/nix.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type Variable struct {
}

type PrintDevEnvArgs struct {
FlakesFilePath string
FlakeDir string
PrintDevEnvCachePath string
UsePrintDevEnvCache bool
}
Expand Down Expand Up @@ -65,7 +65,7 @@ func (*Nix) PrintDevEnv(ctx context.Context, args *PrintDevEnvArgs) (*PrintDevEn
cmd := exec.CommandContext(
ctx,
"nix", "print-dev-env",
args.FlakesFilePath,
args.FlakeDir,
)
cmd.Args = append(cmd.Args, ExperimentalFlags()...)
cmd.Args = append(cmd.Args, "--json")
Expand Down