devconfig

package
v0.0.0-...-3f9dac1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("no devbox config file found")

ErrNotFound occurs when Open or Find cannot find a devbox config file after searching a directory (and possibly its parent directories).

Functions

func IsDefault

func IsDefault(path string) bool

func OSExpandIfPossible

func OSExpandIfPossible(env, existingEnv map[string]string) map[string]string

Types

type Config

type Config struct {
	Root configfile.ConfigFile
	// contains filtered or unexported fields
}

Config represents a base devbox.json as well as any included plugins it may have.

func DefaultConfig

func DefaultConfig() *Config

func Find

func Find(path string) (*Config, error)

Find is like Open except it recursively searches up the directory tree, starting in path. It returns ErrNotFound if path is a valid directory and neither it nor any of its parents contain a config file.

Find stops searching as soon as it encounters a file with a well-known config name (such as devbox.json), even if that config fails to load.

func Init

func Init(dir string) (*Config, error)

func LoadConfigFromURL

func LoadConfigFromURL(ctx context.Context, url string) (*Config, error)

func Open

func Open(path string) (*Config, error)

Open loads a Devbox config from a file or project directory. If path is a directory, Open looks for a well-known config name (such as devbox.json) within it. The error will be ErrNotFound if path is a valid directory without a config file.

Open does not recursively search outside of path. See Find to load a config by walking up the directory tree.

func (*Config) Env

func (c *Config) Env() map[string]string

func (*Config) Hash

func (c *Config) Hash() (string, error)

func (*Config) IncludedPluginConfigs

func (c *Config) IncludedPluginConfigs() []*plugin.Config

func (*Config) InitHook

func (c *Config) InitHook() *shellcmd.Commands

func (*Config) IsEnvsecEnabled

func (c *Config) IsEnvsecEnabled() bool

func (*Config) LoadRecursive

func (c *Config) LoadRecursive(lockfile *lock.File) error

func (*Config) NixPkgsCommitHash

func (c *Config) NixPkgsCommitHash() string

func (*Config) PackageMutator

func (c *Config) PackageMutator() *configfile.PackagesMutator

func (*Config) Packages

func (c *Config) Packages(
	includeRemovedTriggerPackages bool,
) []configfile.Package

Returns all packages including those from included plugins. If includeRemovedTriggerPackages is true, then trigger packages that have been removed will also be returned. These are only used for built-ins (e.g. php) when the plugin creates a flake that is meant to replace the original package.

func (*Config) Scripts

func (c *Config) Scripts() configfile.Scripts

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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