recomputeState updates the local state comprising of: - plugins directories - devbox.lock file - the generated flake - the nix-profile
(ctx context.Context)
| 404 | // - the generated flake |
| 405 | // - the nix-profile |
| 406 | func (d *Devbox) recomputeState(ctx context.Context) error { |
| 407 | defer debug.FunctionTimer().End() |
| 408 | if err := shellgen.GenerateForPrintEnv(ctx, d); err != nil { |
| 409 | return err |
| 410 | } |
| 411 | |
| 412 | // TODO: should this be moved into GenerateForPrintEnv? |
| 413 | // OR into a plugin.GenerateFiles() along with d.pluginManager().Create()? |
| 414 | if err := plugin.RemoveInvalidSymlinks(d.projectDir); err != nil { |
| 415 | return err |
| 416 | } |
| 417 | |
| 418 | return d.syncNixProfileFromFlake(ctx) |
| 419 | } |
| 420 | |
| 421 | func (d *Devbox) profilePath() (string, error) { |
| 422 | absPath := filepath.Join(d.projectDir, nix.ProfilePath) |
no test coverage detected