Documentation ¶
Overview ¶
Package impl creates isolated development environments.
Index ¶
- Variables
- func ExportifySystemPathWithoutWrappers() string
- func GlobalDataPath() (string, error)
- func PrintEnvrcContent(w io.Writer, envFlags devopt.EnvFlags) error
- type Devbox
- func (d *Devbox) Add(ctx context.Context, platforms, excludePlatforms []string, pkgsNames ...string) error
- func (d *Devbox) AllInstallablePackages() ([]*devpkg.Package, error)
- func (d *Devbox) Config() *devconfig.Config
- func (d *Devbox) ConfigHash() (string, error)
- func (d *Devbox) EnvVars(ctx context.Context) ([]string, error)
- func (d *Devbox) Generate(ctx context.Context) error
- func (d *Devbox) GenerateDevcontainer(ctx context.Context, generateOpts devopt.GenerateOpts) error
- func (d *Devbox) GenerateDockerfile(ctx context.Context, generateOpts devopt.GenerateOpts) error
- func (d *Devbox) GenerateEnvrcFile(ctx context.Context, force bool, envFlags devopt.EnvFlags) error
- func (d *Devbox) HasDeprecatedPackages() bool
- func (d *Devbox) Includes() []plugin.Includable
- func (d *Devbox) Info(ctx context.Context, pkg string, markdown bool) (string, error)
- func (d *Devbox) Install(ctx context.Context) error
- func (d *Devbox) InstallRunXPackages(ctx context.Context) error
- func (d *Devbox) InstallablePackages() []*devpkg.Package
- func (d *Devbox) IsEnvEnabled() bool
- func (d *Devbox) ListScripts() []string
- func (d *Devbox) ListServices(ctx context.Context) error
- func (d *Devbox) Lockfile() *lock.File
- func (d *Devbox) NixEnv(ctx context.Context, opts devopt.NixEnvOpts) (string, error)
- func (d *Devbox) NixPkgsCommitHash() string
- func (d *Devbox) PackageNames() []string
- func (d *Devbox) PluginManager() *plugin.Manager
- func (d *Devbox) ProjectDir() string
- func (d *Devbox) Pull(ctx context.Context, opts devopt.PullboxOpts) error
- func (d *Devbox) Push(ctx context.Context, opts devopt.PullboxOpts) error
- func (d *Devbox) Remove(ctx context.Context, pkgs ...string) error
- func (d *Devbox) RestartServices(ctx context.Context, serviceNames ...string) error
- func (d *Devbox) RunScript(ctx context.Context, cmdName string, cmdArgs []string) error
- func (d *Devbox) RunXPaths(ctx context.Context) (string, error)
- func (d *Devbox) Services() (services.Services, error)
- func (d *Devbox) Shell(ctx context.Context) error
- func (d *Devbox) StartProcessManager(ctx context.Context, requestedServices []string, background bool, ...) error
- func (d *Devbox) StartServices(ctx context.Context, serviceNames ...string) error
- func (d *Devbox) StopServices(ctx context.Context, allProjects bool, serviceNames ...string) error
- func (d *Devbox) Update(ctx context.Context, opts devopt.UpdateOpts) error
- type DevboxShell
- type ShellOption
- func WithEnvVariables(envVariables map[string]string) ShellOption
- func WithHistoryFile(historyFile string) ShellOption
- func WithHooksFilePath(hooksFilePath string) ShellOption
- func WithProfile(profileDir string) ShellOption
- func WithProjectDir(projectDir string) ShellOption
- func WithShellStartTime(t time.Time) ShellOption
Constants ¶
This section is empty.
Variables ¶
var ErrNoRecognizableShellFound = errors.New("SHELL in undefined, and couldn't find any common shells in PATH")
Functions ¶
func ExportifySystemPathWithoutWrappers ¶
func ExportifySystemPathWithoutWrappers() string
ExportifySystemPathWithoutWrappers is a small utility to filter WrapperBin paths from PATH
func GlobalDataPath ¶
Types ¶
type Devbox ¶
type Devbox struct { OmitBinWrappersFromPath bool // contains filtered or unexported fields }
func (*Devbox) Add ¶
func (d *Devbox) Add(ctx context.Context, platforms, excludePlatforms []string, pkgsNames ...string) error
Add adds the `pkgs` to the config (i.e. devbox.json) and nix profile for this devbox project nolint:revive // warns about cognitive complexity
func (*Devbox) AllInstallablePackages ¶
AllInstallablePackages returns installable user packages and plugin packages concatenated in correct order
func (*Devbox) ConfigHash ¶
func (*Devbox) GenerateDevcontainer ¶
GenerateDevcontainer generates devcontainer.json and Dockerfile for vscode run-in-container and GitHub Codespaces
func (*Devbox) GenerateDockerfile ¶
GenerateDockerfile generates a Dockerfile that replicates the synopkg.github.io/devboxell
func (*Devbox) GenerateEnvrcFile ¶
GenerateEnvrcFile generates a .envrc file that makes direnv integration convenient
func (*Devbox) HasDeprecatedPackages ¶
func (*Devbox) Includes ¶
func (d *Devbox) Includes() []plugin.Includable
func (*Devbox) Install ¶
Install ensures that all the packages in the config are installed and creates all wrappers, but does not run init hooks. It is used to power devbox install cli command.
func (*Devbox) InstallRunXPackages ¶
func (*Devbox) InstallablePackages ¶
InstallablePackages returns the packages that are to be installed
func (*Devbox) IsEnvEnabled ¶
IsEnvEnabled checks if the devbox environment is enabled. This allows us to differentiate between global and individual project shells.
func (*Devbox) ListScripts ¶
func (*Devbox) NixPkgsCommitHash ¶
func (*Devbox) PackageNames ¶
ConfigPackageNames returns the package names as defined in devbox.json
func (*Devbox) PluginManager ¶
func (*Devbox) ProjectDir ¶
func (*Devbox) Remove ¶
Remove removes the `pkgs` from the config (i.e. devbox.json) and nix profile for this devbox project
func (*Devbox) RestartServices ¶
func (*Devbox) StartProcessManager ¶
func (*Devbox) StartServices ¶
func (*Devbox) StopServices ¶
type DevboxShell ¶
type DevboxShell struct {
// contains filtered or unexported fields
}
DevboxShell configures a user's shell to run in Devbox. Its zero value is a fallback shell that launches a regular Nix shell.
func NewDevboxShell ¶
func NewDevboxShell(devbox *Devbox, opts ...ShellOption) (*DevboxShell, error)
NewDevboxShell initializes the DevboxShell struct so it can be used to start a shell environment for the devbox project.
func (*DevboxShell) Run ¶
func (s *DevboxShell) Run() error
type ShellOption ¶
type ShellOption func(*DevboxShell)
func WithEnvVariables ¶
func WithEnvVariables(envVariables map[string]string) ShellOption
TODO: Consider removing this once plugins add env vars directly to binaries via wrapper scripts.
func WithHistoryFile ¶
func WithHistoryFile(historyFile string) ShellOption
func WithHooksFilePath ¶
func WithHooksFilePath(hooksFilePath string) ShellOption
func WithProfile ¶
func WithProfile(profileDir string) ShellOption
func WithProjectDir ¶
func WithProjectDir(projectDir string) ShellOption
func WithShellStartTime ¶
func WithShellStartTime(t time.Time) ShellOption