impl

package
v0.0.0-...-b872246 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2023 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Overview

Package impl creates isolated development environments.

Index

Constants

This section is empty.

Variables

View Source
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

func GlobalDataPath() (string, error)

func PrintEnvrcContent

func PrintEnvrcContent(w io.Writer, envFlags devopt.EnvFlags) error

Types

type Devbox

type Devbox struct {
	OmitBinWrappersFromPath bool
	// contains filtered or unexported fields
}

func Open

func Open(opts *devopt.Opts) (*Devbox, error)

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

func (d *Devbox) AllInstallablePackages() ([]*devpkg.Package, error)

AllInstallablePackages returns installable user packages and plugin packages concatenated in correct order

func (*Devbox) Config

func (d *Devbox) Config() *devconfig.Config

func (*Devbox) ConfigHash

func (d *Devbox) ConfigHash() (string, error)

func (*Devbox) EnvVars

func (d *Devbox) EnvVars(ctx context.Context) ([]string, error)

func (*Devbox) Generate

func (d *Devbox) Generate(ctx context.Context) error

func (*Devbox) GenerateDevcontainer

func (d *Devbox) GenerateDevcontainer(ctx context.Context, generateOpts devopt.GenerateOpts) error

GenerateDevcontainer generates devcontainer.json and Dockerfile for vscode run-in-container and GitHub Codespaces

func (*Devbox) GenerateDockerfile

func (d *Devbox) GenerateDockerfile(ctx context.Context, generateOpts devopt.GenerateOpts) error

GenerateDockerfile generates a Dockerfile that replicates the synopkg.github.io/devboxell

func (*Devbox) GenerateEnvrcFile

func (d *Devbox) GenerateEnvrcFile(ctx context.Context, force bool, envFlags devopt.EnvFlags) error

GenerateEnvrcFile generates a .envrc file that makes direnv integration convenient

func (*Devbox) HasDeprecatedPackages

func (d *Devbox) HasDeprecatedPackages() bool

func (*Devbox) Includes

func (d *Devbox) Includes() []plugin.Includable

func (*Devbox) Info

func (d *Devbox) Info(ctx context.Context, pkg string, markdown bool) (string, error)

func (*Devbox) Install

func (d *Devbox) Install(ctx context.Context) error

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 (d *Devbox) InstallRunXPackages(ctx context.Context) error

func (*Devbox) InstallablePackages

func (d *Devbox) InstallablePackages() []*devpkg.Package

InstallablePackages returns the packages that are to be installed

func (*Devbox) IsEnvEnabled

func (d *Devbox) IsEnvEnabled() bool

IsEnvEnabled checks if the devbox environment is enabled. This allows us to differentiate between global and individual project shells.

func (*Devbox) ListScripts

func (d *Devbox) ListScripts() []string

func (*Devbox) ListServices

func (d *Devbox) ListServices(ctx context.Context) error

func (*Devbox) Lockfile

func (d *Devbox) Lockfile() *lock.File

func (*Devbox) NixEnv

func (d *Devbox) NixEnv(ctx context.Context, opts devopt.NixEnvOpts) (string, error)

func (*Devbox) NixPkgsCommitHash

func (d *Devbox) NixPkgsCommitHash() string

func (*Devbox) PackageNames

func (d *Devbox) PackageNames() []string

ConfigPackageNames returns the package names as defined in devbox.json

func (*Devbox) PluginManager

func (d *Devbox) PluginManager() *plugin.Manager

func (*Devbox) ProjectDir

func (d *Devbox) ProjectDir() string

func (*Devbox) Pull

func (d *Devbox) Pull(ctx context.Context, opts devopt.PullboxOpts) error

func (*Devbox) Push

func (d *Devbox) Push(ctx context.Context, opts devopt.PullboxOpts) error

func (*Devbox) Remove

func (d *Devbox) Remove(ctx context.Context, pkgs ...string) error

Remove removes the `pkgs` from the config (i.e. devbox.json) and nix profile for this devbox project

func (*Devbox) RestartServices

func (d *Devbox) RestartServices(ctx context.Context, serviceNames ...string) error

func (*Devbox) RunScript

func (d *Devbox) RunScript(ctx context.Context, cmdName string, cmdArgs []string) error

func (*Devbox) RunXPaths

func (d *Devbox) RunXPaths(ctx context.Context) (string, error)

func (*Devbox) Services

func (d *Devbox) Services() (services.Services, error)

func (*Devbox) Shell

func (d *Devbox) Shell(ctx context.Context) error

func (*Devbox) StartProcessManager

func (d *Devbox) StartProcessManager(
	ctx context.Context,
	requestedServices []string,
	background bool,
	processComposeFileOrDir string,
) error

func (*Devbox) StartServices

func (d *Devbox) StartServices(ctx context.Context, serviceNames ...string) error

func (*Devbox) StopServices

func (d *Devbox) StopServices(ctx context.Context, allProjects bool, serviceNames ...string) error

func (*Devbox) Update

func (d *Devbox) Update(ctx context.Context, opts devopt.UpdateOpts) error

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL